mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Don't spill out of document when moving right and left
This commit is contained in:
@@ -37,7 +37,7 @@ class Editor extends Template
|
||||
{ row, col } = @getPosition()
|
||||
if col < @buffer.getLine(row).length
|
||||
col++
|
||||
else
|
||||
else if row < @buffer.numLines() - 1
|
||||
row++
|
||||
col = 0
|
||||
@setPosition({row, col})
|
||||
@@ -54,7 +54,7 @@ class Editor extends Template
|
||||
{ row, col } = @getPosition()
|
||||
if col > 0
|
||||
col--
|
||||
else
|
||||
else if row > 0
|
||||
row--
|
||||
col = @buffer.getLine(row).length
|
||||
|
||||
|
||||
Reference in New Issue
Block a user