Update highlighted line when editor selection changes

This commit is contained in:
Kevin Sawicki
2012-10-01 15:19:25 -07:00
parent c7361d487f
commit 41cdf130fb
2 changed files with 2 additions and 1 deletions

View File

@@ -1664,7 +1664,7 @@ describe "Editor", ->
expect(editor.find('.line.cursor-line').length).toBe 1
expect(editor.find('.line.cursor-line').text()).toBe buffer.lineForRow(1)
fit "when a newline is deleted with backspace, the line of the new cursor position is highlighted (regression)", ->
it "when a newline is deleted with backspace, the line of the new cursor position is highlighted", ->
editor.setCursorScreenPosition([1,0])
editor.backspace()
expect(editor.find('.line.cursor-line').length).toBe 1

View File

@@ -344,6 +344,7 @@ class Editor extends View
@gutter.addClass('drop-shadow')
@on 'cursor-move', => @highlightCursorLine()
@on 'editor-selection-change', => @highlightCursorLine()
selectOnMousemoveUntilMouseup: ->
moveHandler = (e) => @selectToScreenPosition(@screenPositionFromMouseEvent(e))