summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2016-06-08 00:54:21 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2016-06-08 00:54:21 +0900
commit56fb2f00b3d3b6eed606d58411b5e6495ec99afc (patch)
tree081374e554be5988e13b86ad155e433e6a8dec9f
parent1c86aaf342120700c169683dd538a6d15b184369 (diff)
downloadfzf-56fb2f00b3d3b6eed606d58411b5e6495ec99afc.tar.gz
Use single-quoted strings in execute action
Close #590
-rw-r--r--CHANGELOG.md5
-rw-r--r--src/terminal.go2
2 files changed, 6 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4047be38..558da3e9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,11 @@
CHANGELOG
=========
+0.12.3
+------
+- `{}` in execute action is replaced to the single-quoted string of the
+ current line
+
0.12.2
------
diff --git a/src/terminal.go b/src/terminal.go
index c4402926..b1455e8e 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -743,7 +743,7 @@ func keyMatch(key int, event C.Event) bool {
}
func quoteEntry(entry string) string {
- return fmt.Sprintf("%q", entry)
+ return "'" + strings.Replace(entry, "'", "'\\''", -1) + "'"
}
func executeCommand(template string, replacement string) {