ctrl-a on an empty line stays on that same line.

Fixes #95
This commit is contained in:
Corey Johnson & Nathan Sobo
2012-11-19 10:01:53 -08:00
parent 5841eba1bc
commit bfb1742285
7 changed files with 20 additions and 22 deletions

View File

@@ -133,11 +133,11 @@ class Buffer
lineLengthForRow: (row) ->
@lines[row].length
rangeForRow: (row) ->
if row == @getLastRow()
new Range([row, 0], [row, @lineLengthForRow(row)])
else
rangeForRow: (row, { includeNewline } = {}) ->
if includeNewline and row < @getLastRow()
new Range([row, 0], [row + 1, 0])
else
new Range([row, 0], [row, @lineLengthForRow(row)])
getLineCount: ->
@getLines().length