diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2019-11-21 23:06:13 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2019-11-21 23:06:13 +0900 |
| commit | 60465c4664bd390c49d5eeb46abcbf7d34c36cc2 (patch) | |
| tree | 9a27be8683a2c16da43ad6cfec78b777de70db04 /src/options.go | |
| parent | c03c058bd52f14f6eba57e83864ad5a78c5e57b9 (diff) | |
| download | fzf-60465c4664bd390c49d5eeb46abcbf7d34c36cc2.tar.gz | |
Fix parse error of --bind expression
Diffstat (limited to 'src/options.go')
| -rw-r--r-- | src/options.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/options.go b/src/options.go index 9b20e55a..bdd16e1c 100644 --- a/src/options.go +++ b/src/options.go @@ -648,14 +648,18 @@ func init() { // Backreferences are not supported. // "~!@#$%^&*;/|".each_char.map { |c| Regexp.escape(c) }.map { |c| "#{c}[^#{c}]*#{c}" }.join('|') executeRegexp = regexp.MustCompile( - `(?si):(execute(?:-multi|-silent)?|reload):.+|:(execute(?:-multi|-silent)?|reload)(\([^)]*\)|\[[^\]]*\]|~[^~]*~|![^!]*!|@[^@]*@|\#[^\#]*\#|\$[^\$]*\$|%[^%]*%|\^[^\^]*\^|&[^&]*&|\*[^\*]*\*|;[^;]*;|/[^/]*/|\|[^\|]*\|)`) + `(?si)[:+](execute(?:-multi|-silent)?|reload):.+|[:+](execute(?:-multi|-silent)?|reload)(\([^)]*\)|\[[^\]]*\]|~[^~]*~|![^!]*!|@[^@]*@|\#[^\#]*\#|\$[^\$]*\$|%[^%]*%|\^[^\^]*\^|&[^&]*&|\*[^\*]*\*|;[^;]*;|/[^/]*/|\|[^\|]*\|)`) } func parseKeymap(keymap map[int][]action, str string) { masked := executeRegexp.ReplaceAllStringFunc(str, func(src string) string { - prefix := ":execute" - if strings.HasPrefix(src, ":reload") { - prefix = ":reload" + symbol := ":" + if strings.HasPrefix(src, "+") { + symbol = "+" + } + prefix := symbol + "execute" + if strings.HasPrefix(src[1:], "reload") { + prefix = symbol + "reload" } else if src[len(prefix)] == '-' { c := src[len(prefix)+1] if c == 's' || c == 'S' { |
