mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Check selection being empty before comparing highlighted rows
This commit is contained in:
@@ -93,7 +93,7 @@ class Gutter extends View
|
||||
if @editor().getSelection().isEmpty()
|
||||
row = @editor().getCursorScreenPosition().row
|
||||
rowRange = new Range([row, 0], [row, 0])
|
||||
return if @highlightedRows?.isEqual(rowRange) and @selectionEmpty
|
||||
return if @selectionEmpty and @highlightedRows?.isEqual(rowRange)
|
||||
|
||||
@removeLineHighlights()
|
||||
@addLineHighlight(row, true)
|
||||
@@ -102,7 +102,7 @@ class Gutter extends View
|
||||
else
|
||||
selectedRows = @editor().getSelection().getScreenRange()
|
||||
selectedRows = new Range([selectedRows.start.row, 0], [selectedRows.end.row, 0])
|
||||
return if @highlightedRows?.isEqual(selectedRows) and not @selectionEmpty
|
||||
return if not @selectionEmpty and @highlightedRows?.isEqual(selectedRows)
|
||||
|
||||
@removeLineHighlights()
|
||||
for row in [selectedRows.start.row..selectedRows.end.row]
|
||||
|
||||
Reference in New Issue
Block a user