Use single-quoted strings in execute action

Close #590
This commit is contained in:
Junegunn Choi 2016-06-08 00:54:21 +09:00
parent 1c86aaf342
commit 56fb2f00b3
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627
2 changed files with 6 additions and 1 deletions

View File

@ -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
------

View File

@ -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) {