]> git.lizzy.rs Git - micro.git/commitdiff
Fix relocation with softwrap on small buffers
authorZachary Yedidia <zyedidia@gmail.com>
Sat, 15 Feb 2020 20:38:20 +0000 (15:38 -0500)
committerZachary Yedidia <zyedidia@gmail.com>
Sat, 15 Feb 2020 20:38:20 +0000 (15:38 -0500)
Fixes #1512

internal/action/actions.go
internal/display/bufwindow.go

index 16c87b6d58ca56ae6f59c05830125f3cbf669d52..c13b8c45df5fa6b8a15a4dff017bee35034a8264 100644 (file)
@@ -396,6 +396,7 @@ func (h *BufPane) CursorStart() bool {
        h.Cursor.Deselect(true)
        h.Cursor.X = 0
        h.Cursor.Y = 0
+       h.Cursor.StoreVisualX()
        h.Relocate()
        return true
 }
index 42fd489c31faa6d03745ca3ab7b787e7ec84cac0..7ebdcf34e2cb78437a6bcc487e8772413deb5669 100644 (file)
@@ -136,9 +136,6 @@ func (w *BufWindow) Relocate() bool {
        if w.drawStatus {
                h--
        }
-       if b.LinesNum() <= h {
-               height = w.Height
-       }
        ret := false
        activeC := w.Buf.GetActiveCursor()
        cy := activeC.Y