From 8435e0176b2bf0be1ef4fa679db216f81baafda6 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 27 Jun 2014 05:10:20 -0600 Subject: [PATCH] Add selection-line class to old editor gutter for forward-compatibility The React editor does not apply the .cursor-line-no-selection class, but instead relies on a combination of .cursor-line and .selection-line for selectors that want to target the cursor line when there is no selection. This allows themes to be upgraded to support the React editor and the old editor at the same time. --- src/gutter-view.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gutter-view.coffee b/src/gutter-view.coffee index aabc515fc..0caccc4bc 100644 --- a/src/gutter-view.coffee +++ b/src/gutter-view.coffee @@ -237,6 +237,7 @@ class GutterView extends View return unless @highlightedLineNumbers for line in @highlightedLineNumbers line.classList.remove('cursor-line') + line.classList.remove('selection-line') line.classList.remove('cursor-line-no-selection') @highlightedLineNumbers = null @@ -245,7 +246,10 @@ class GutterView extends View @highlightedLineNumbers ?= [] if highlightedLineNumber = @lineNumbers[0].children[row - @firstScreenRow] highlightedLineNumber.classList.add('cursor-line') - highlightedLineNumber.classList.add('cursor-line-no-selection') if emptySelection + if emptySelection + highlightedLineNumber.classList.add('cursor-line-no-selection') + else + highlightedLineNumber.classList.add('selection-line') @highlightedLineNumbers.push(highlightedLineNumber) highlightLines: ->