From a08f457cd0ac0c4bbbbc36f0230ab606cfc0632b Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Sat, 28 May 2016 11:40:22 -0400 Subject: [PATCH] Allow users to insert \t and \n in replace commands Fixes #144 --- cmd/micro/command.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/micro/command.go b/cmd/micro/command.go index 1d8d0246..695d446f 100644 --- a/cmd/micro/command.go +++ b/cmd/micro/command.go @@ -141,6 +141,9 @@ func HandleCommand(input string) { // We replace all escaped double quotes to real double quotes search = strings.Replace(search, `\"`, `"`, -1) replace = strings.Replace(replace, `\"`, `"`, -1) + // Replace some things so users can actually insert newlines and tabs in replacements + replace = strings.Replace(replace, "\\n", "\n", -1) + replace = strings.Replace(replace, "\\t", "\t", -1) regex, err := regexp.Compile(search) if err != nil {