Make cursor follow selections

Fixes #1624
This commit is contained in:
Zachary Yedidia
2020-04-21 09:33:21 -04:00
parent 74523d28c5
commit eb7189dcdb
2 changed files with 1 additions and 3 deletions

View File

@@ -761,6 +761,7 @@ func (h *BufPane) ReplaceCmd(args []string) {
h.Cursor.SetSelectionStart(locs[0])
h.Cursor.SetSelectionEnd(locs[1])
h.Cursor.GotoLoc(locs[0])
h.Relocate()

View File

@@ -139,9 +139,6 @@ func (w *BufWindow) Relocate() bool {
ret := false
activeC := w.Buf.GetActiveCursor()
cy := activeC.Y
if activeC.HasSelection() {
cy = activeC.CurSelection[0].Y
}
scrollmargin := int(b.Settings["scrollmargin"].(float64))
if cy < w.StartLine+scrollmargin && cy > scrollmargin-1 {
w.StartLine = cy - scrollmargin