mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-19 07:15:34 -04:00
Merge 5a8d691277
into 5eddf5b85d
This commit is contained in:
commit
f43864638e
@ -969,7 +969,17 @@ func (h *BufPane) ReplaceCmd(args []string) {
|
|||||||
searchLoc = start // otherwise me might start at the end
|
searchLoc = start // otherwise me might start at the end
|
||||||
}
|
}
|
||||||
if all {
|
if all {
|
||||||
nreplaced, _ = h.Buf.ReplaceRegex(start, end, regex, replace, !noRegex)
|
var deltaX int
|
||||||
|
nreplaced, deltaX = h.Buf.ReplaceRegex(start, end, regex, replace, !noRegex)
|
||||||
|
if selection {
|
||||||
|
if start.LessEqual(end) {
|
||||||
|
newEnd := end.Move(deltaX, h.Buf)
|
||||||
|
h.Cursor.SetSelectionEnd(newEnd)
|
||||||
|
h.Cursor.GotoLoc(newEnd)
|
||||||
|
} else {
|
||||||
|
h.Cursor.SetSelectionStart(start.Move(deltaX, h.Buf))
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
inRange := func(l buffer.Loc) bool {
|
inRange := func(l buffer.Loc) bool {
|
||||||
return l.GreaterEqual(start) && l.LessEqual(end)
|
return l.GreaterEqual(start) && l.LessEqual(end)
|
||||||
|
Loading…
Reference in New Issue
Block a user