Up arrow on first line brings to start

Fixes #1701
This commit is contained in:
Zachary Yedidia
2020-06-03 00:27:24 -04:00
parent a95b17a4e7
commit 8cf56bfc56

View File

@@ -242,6 +242,12 @@ func (c *Cursor) UpN(amount int) {
if c.X > util.CharacterCount(bytes) || (amount < 0 && proposedY == c.Y) {
c.X = util.CharacterCount(bytes)
c.StoreVisualX()
}
if c.X < 0 || (amount > 0 && proposedY == c.Y) {
c.X = 0
c.StoreVisualX()
}
c.Y = proposedY