mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Don't highlight the current line unless the selection is empty
This commit is contained in:
@@ -1725,6 +1725,10 @@ describe "Editor", ->
|
||||
expect(editor.find('.line.cursor-line').length).toBe 1
|
||||
expect(editor.find('.line.cursor-line').text()).toBe buffer.lineForRow(1)
|
||||
|
||||
it "does not highlight the line if the selection is not empty", ->
|
||||
editor.setSelectedBufferRange([[1, 0], [1, 1]])
|
||||
expect(editor.find('.line.cursor-line').length).toBe 0
|
||||
|
||||
it "when a newline is deleted with backspace, the line of the new cursor position is highlighted", ->
|
||||
editor.setCursorScreenPosition([1,0])
|
||||
editor.backspace()
|
||||
|
||||
@@ -971,7 +971,7 @@ class Editor extends View
|
||||
return if @mini
|
||||
|
||||
@highlightedLine?.removeClass('cursor-line')
|
||||
if @getSelection().isSingleScreenLine()
|
||||
if @getSelection().isEmpty()
|
||||
@highlightedLine = @lineElementForScreenRow(@getCursorScreenRow())
|
||||
@highlightedLine.addClass('cursor-line')
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user