mirror of
https://github.com/atom/atom.git
synced 2026-02-09 14:15:24 -05:00
Cursor can move to last row when lines are wrapped
This commit is contained in:
@@ -60,11 +60,7 @@ class Cursor extends View
|
||||
moveDown: ->
|
||||
{ row, column } = @getScreenPosition()
|
||||
column = @goalColumn if @goalColumn?
|
||||
if row < @editor.buffer.numLines() - 1
|
||||
@setScreenPosition({row: row + 1, column: column})
|
||||
else
|
||||
@moveToLineEnd()
|
||||
|
||||
@setScreenPosition({row: row + 1, column: column})
|
||||
@goalColumn = column
|
||||
|
||||
moveToLineEnd: ->
|
||||
|
||||
@@ -141,6 +141,12 @@ class Editor extends View
|
||||
linesForScreenRows: (start, end) ->
|
||||
@lineWrapper.linesForScreenRows(start, end)
|
||||
|
||||
screenLineCount: ->
|
||||
@lineWrapper.lineCount()
|
||||
|
||||
lastScreenRow: ->
|
||||
@screenLineCount() - 1
|
||||
|
||||
setBuffer: (@buffer) ->
|
||||
@highlighter = new Highlighter(@buffer)
|
||||
@lineFolder = new LineFolder(@highlighter)
|
||||
|
||||
Reference in New Issue
Block a user