Revert "Use byte slice for insert"

This reverts commit 0c844c2f5b.
This commit is contained in:
Zachary Yedidia
2019-01-16 22:32:33 -05:00
parent 069f7d20bc
commit 9336e09532
8 changed files with 29 additions and 25 deletions

View File

@@ -571,6 +571,7 @@ func (h *BufHandler) ReplaceCmd(args []string) {
}
replace := []byte(args[1])
replaceStr := args[1]
var regex *regexp.Regexp
var err error
@@ -619,7 +620,7 @@ func (h *BufHandler) ReplaceCmd(args []string) {
InfoBar.YNPrompt("Perform replacement (y,n,esc)", func(yes, canceled bool) {
if !canceled && yes {
h.Buf.Replace(locs[0], locs[1], replace)
h.Buf.Replace(locs[0], locs[1], replaceStr)
searchLoc = locs[0]
searchLoc.X += utf8.RuneCount(replace)
h.Cursor.Loc = searchLoc