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.
This commit is contained in:
Nathan Sobo
2014-06-27 05:10:20 -06:00
parent 5bdaf3cbe4
commit 8435e0176b

View File

@@ -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: ->