From cc994b6241af77456a43e116bdcd0a8da902b7eb Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Sat, 15 Feb 2020 15:38:20 -0500 Subject: [PATCH] Fix relocation with softwrap on small buffers Fixes #1512 --- internal/action/actions.go | 1 + internal/display/bufwindow.go | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/action/actions.go b/internal/action/actions.go index 16c87b6d..c13b8c45 100644 --- a/internal/action/actions.go +++ b/internal/action/actions.go @@ -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 } diff --git a/internal/display/bufwindow.go b/internal/display/bufwindow.go index 42fd489c..7ebdcf34 100644 --- a/internal/display/bufwindow.go +++ b/internal/display/bufwindow.go @@ -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