]> git.lizzy.rs Git - micro.git/blobdiff - internal/action/command.go
Support regex capture groups in replace command
[micro.git] / internal / action / command.go
index 667de11b921b2f04400b7b1902bfada08f70b17e..2d9b2fbbbb361671f7fe8b4f85d3db9b18334909 100644 (file)
@@ -764,7 +764,7 @@ func (h *BufPane) ReplaceCmd(args []string) {
 
                        InfoBar.YNPrompt("Perform replacement (y,n,esc)", func(yes, canceled bool) {
                                if !canceled && yes {
-                                       h.Buf.Replace(locs[0], locs[1], replaceStr)
+                                       h.Buf.ReplaceRegex(locs[0], locs[1], regex, replace)
 
                                        searchLoc = locs[0]
                                        searchLoc.X += utf8.RuneCount(replace)