From 41cdf130fbcfe98d305f80f4b759315c089d23c8 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 1 Oct 2012 15:19:25 -0700 Subject: [PATCH] Update highlighted line when editor selection changes --- spec/app/editor-spec.coffee | 2 +- src/app/editor.coffee | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index 3b315725d..d8eb7a744 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -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 diff --git a/src/app/editor.coffee b/src/app/editor.coffee index 840e5c22f..39ec9190e 100644 --- a/src/app/editor.coffee +++ b/src/app/editor.coffee @@ -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))