]> git.lizzy.rs Git - micro.git/commitdiff
Fix moving to end of line on cursor down v1.3.2
authorZachary Yedidia <zyedidia@gmail.com>
Fri, 15 Sep 2017 20:09:33 +0000 (16:09 -0400)
committerZachary Yedidia <zyedidia@gmail.com>
Fri, 15 Sep 2017 20:09:33 +0000 (16:09 -0400)
cmd/micro/cursor.go

index 65baa773ae0970723f5f19f2cedef364b0f6804c..a4a243d12798b5becc886a1e8dba013ecaf2bf43 100644 (file)
@@ -258,7 +258,7 @@ func (c *Cursor) UpN(amount int) {
        runes := []rune(c.buf.Line(c.Y))
        c.X = c.GetCharPosInLine(proposedY, c.LastVisualX)
 
-       if c.X > len(runes) {
+       if c.X > len(runes) || (amount < 0 && proposedY == c.Y) {
                c.X = len(runes)
        }