diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2022-12-17 18:59:16 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2022-12-18 00:26:31 +0900 |
commit | 51c518da1e981dddda18e55272be482e972d6861 (patch) | |
tree | a742ad69ed79526293e22e05d6cf0974e54d3457 /src/options.go | |
parent | a3b6b03dfb8b8e65681c363ad1a9837d0e64f59b (diff) |
Add change-query(...) action
Diffstat (limited to 'src/options.go')
-rw-r--r-- | src/options.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/options.go b/src/options.go index 4728adff..64cf5609 100644 --- a/src/options.go +++ b/src/options.go @@ -889,7 +889,7 @@ 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|preview|change-prompt|change-preview-window|change-preview|(?:re|un)bind):.+|[:+](execute(?:-multi|-silent)?|reload|preview|change-prompt|change-preview-window|change-preview|(?:re|un)bind)(\([^)]*\)|\[[^\]]*\]|~[^~]*~|![^!]*!|@[^@]*@|\#[^\#]*\#|\$[^\$]*\$|%[^%]*%|\^[^\^]*\^|&[^&]*&|\*[^\*]*\*|;[^;]*;|/[^/]*/|\|[^\|]*\|)`) + `(?si)[:+](execute(?:-multi|-silent)?|reload|preview|change-query|change-prompt|change-preview-window|change-preview|(?:re|un)bind):.+|[:+](execute(?:-multi|-silent)?|reload|preview|change-query|change-prompt|change-preview-window|change-preview|(?:re|un)bind)(\([^)]*\)|\[[^\]]*\]|~[^~]*~|![^!]*!|@[^@]*@|\#[^\#]*\#|\$[^\$]*\$|%[^%]*%|\^[^\^]*\^|&[^&]*&|\*[^\*]*\*|;[^;]*;|/[^/]*/|\|[^\|]*\|)`) splitRegexp = regexp.MustCompile("[,:]+") } @@ -912,6 +912,8 @@ func parseKeymap(keymap map[tui.Event][]*action, str string) { prefix = symbol + "unbind" } else if strings.HasPrefix(src[1:], "rebind") { prefix = symbol + "rebind" + } else if strings.HasPrefix(src[1:], "change-query") { + prefix = symbol + "change-query" } else if strings.HasPrefix(src[1:], "change-prompt") { prefix = symbol + "change-prompt" } else if src[len(prefix)] == '-' { @@ -1121,6 +1123,8 @@ func parseKeymap(keymap map[tui.Event][]*action, str string) { offset = len("change-preview") case actChangePrompt: offset = len("change-prompt") + case actChangeQuery: + offset = len("change-query") case actUnbind: offset = len("unbind") case actRebind: @@ -1180,6 +1184,8 @@ func isExecuteAction(str string) actionType { return actChangePreview case "change-prompt": return actChangePrompt + case "change-query": + return actChangeQuery case "execute": return actExecute case "execute-silent": |