Select all adjacent whitespace on double click

Cursor::isSurroundedByWhitespace was use column 0 instead of the
position right before the cursor.
This commit is contained in:
Kevin Sawicki
2014-04-29 16:52:02 -07:00
parent 6ace49b0e8
commit aa4749f175
2 changed files with 25 additions and 1 deletions

View File

@@ -144,7 +144,7 @@ class Cursor extends Model
# Returns a {Boolean}.
isSurroundedByWhitespace: ->
{row, column} = @getBufferPosition()
range = [[row, Math.min(0, column - 1)], [row, Math.max(0, column + 1)]]
range = [[row, Math.max(0, column - 1)], [row, Math.max(0, column + 1)]]
/^\s+$/.test @editor.getTextInBufferRange(range)
# Public: Returns whether the cursor is currently between a word and non-word