mirror of
https://github.com/atom/atom.git
synced 2026-02-14 16:45:14 -05:00
Make moveLeft() with huge values span multiple rows
This commit is contained in:
@@ -274,9 +274,14 @@ class Cursor extends Model
|
||||
|
||||
if newColumn >= 0
|
||||
column = newColumn
|
||||
else if row > 0
|
||||
row--
|
||||
column = @editor.lineTextForScreenRow(row).length + newColumn + 1
|
||||
else
|
||||
columnDelta = -(newColumn + 1)
|
||||
while columnDelta >= 0 and row > 0
|
||||
row--
|
||||
rowLength = @editor.lineTextForScreenRow(row).length
|
||||
column = rowLength - columnDelta
|
||||
columnDelta -= rowLength
|
||||
column = Math.max(column, 0)
|
||||
|
||||
@setScreenPosition({row, column})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user