Relocate during replace

Fixes #1587
This commit is contained in:
Zachary Yedidia
2020-03-24 11:33:52 -04:00
parent c76a973877
commit 60c8c81da3
2 changed files with 6 additions and 0 deletions

View File

@@ -139,6 +139,9 @@ 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