Fix issue with search and replace at the end of a range

This commit is contained in:
Zachary Yedidia
2020-06-18 16:38:10 -04:00
parent 8cbe7fa92b
commit f5dc0a51ba
2 changed files with 21 additions and 3 deletions

View File

@@ -832,7 +832,9 @@ func (h *BufPane) ReplaceCmd(args []string) {
searchLoc = locs[0]
searchLoc.X += nrunes + locs[0].Diff(locs[1], h.Buf)
end.Move(nrunes, h.Buf)
if end.Y == locs[1].Y {
end = end.Move(nrunes, h.Buf)
}
h.Cursor.Loc = searchLoc
nreplaced++
} else if !canceled && !yes {