mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
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:
@@ -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: ->
|
||||
|
||||
Reference in New Issue
Block a user