Don't highlight line if selection is multiline

This commit is contained in:
Kevin Sawicki
2012-09-28 19:13:22 -07:00
parent 12a30873cf
commit 33abaff747
3 changed files with 21 additions and 5 deletions

View File

@@ -943,4 +943,5 @@ class Editor extends View
@cursorScreenRow = @getCursorScreenPosition().row
screenRow = @cursorScreenRow - @firstRenderedScreenRow
@find('.line.cursor-line').removeClass('cursor-line')
@find(".line:eq(#{screenRow})").addClass('cursor-line')
if !@getSelection().isMultiLine()
@find(".line:eq(#{screenRow})").addClass('cursor-line')

View File

@@ -31,6 +31,10 @@ class Selection
isReversed: ->
not @isEmpty() and @cursor.getBufferPosition().isLessThan(@anchor.getBufferPosition())
isMultiLine: ->
range = @getScreenRange()
range.start.row != range.end.row
getScreenRange: ->
if @anchor
new Range(@anchor.getScreenPosition(), @cursor.getScreenPosition())