mirror of
https://github.com/atom/atom.git
synced 2026-02-16 09:35:54 -05:00
Use softWrapAtNewLines in moveDown and moveUp
/cc: @nathansobo
This commit is contained in:
@@ -271,7 +271,7 @@ class Cursor extends Model
|
||||
{ row, column } = @getScreenPosition()
|
||||
|
||||
column = @goalColumn if @goalColumn?
|
||||
@setScreenPosition({row: row - rowCount, column: column})
|
||||
@setScreenPosition({row: row - rowCount, column: column}, wrapAtSoftNewlines: true)
|
||||
@goalColumn = column
|
||||
|
||||
# Public: Moves the cursor down one screen row.
|
||||
@@ -288,7 +288,7 @@ class Cursor extends Model
|
||||
{ row, column } = @getScreenPosition()
|
||||
|
||||
column = @goalColumn if @goalColumn?
|
||||
@setScreenPosition({row: row + rowCount, column: column})
|
||||
@setScreenPosition({row: row + rowCount, column: column}, wrapAtSoftNewlines: true)
|
||||
@goalColumn = column
|
||||
|
||||
# Public: Moves the cursor left one screen column.
|
||||
@@ -304,14 +304,13 @@ class Cursor extends Model
|
||||
else
|
||||
{row, column} = @getScreenPosition()
|
||||
|
||||
originalRow = row
|
||||
while columnCount > column and row > 0
|
||||
columnCount -= column
|
||||
column = @editor.lineTextForScreenRow(--row).length
|
||||
columnCount-- # subtract 1 for the row move
|
||||
|
||||
column = column - columnCount
|
||||
@setScreenPosition({row, column}, wrapAtSoftNewlines: originalRow == row)
|
||||
@setScreenPosition({row, column})
|
||||
|
||||
# Public: Moves the cursor right one screen column.
|
||||
#
|
||||
|
||||
@@ -846,10 +846,10 @@ class DisplayBuffer extends Model
|
||||
column = screenLine.clipScreenColumn(maxScreenColumn - 1)
|
||||
else if screenLine.isColumnInsidePhantomToken(column)
|
||||
if wrapAtSoftNewlines
|
||||
column = screenLine.clipScreenColumn(0)
|
||||
else
|
||||
row--
|
||||
column = @screenLines[row].getMaxScreenColumn() - 1
|
||||
else
|
||||
column = screenLine.clipScreenColumn(0)
|
||||
else if wrapBeyondNewlines and column > maxScreenColumn and row < @getLastRow()
|
||||
row++
|
||||
column = 0
|
||||
|
||||
Reference in New Issue
Block a user