Fold g:fzf_action keys before the show key check

fzf#wrap turns them into --expect, which fzf matches with the same case
folding as a binding, so g:fzf_action = {'CTRL-O': 'split'} slipped past the
check. The footer advertised Show while --expect closed fzf instead.
This commit is contained in:
Junegunn Choi
2026-08-26 22:46:09 +09:00
parent b83a8e5ddd
commit 4ae5a659f8
+5 -2
View File
@@ -824,10 +824,13 @@ function! s:can_show(spec, bang, key, claimed) abort
" key would win over ours, and a key the command binds itself would win by
" coming later in the options. Any key of the list losing disables all of
" them, so that the footer cannot advertise a key that does nothing
let actions = get(g:, 'fzf_action', s:default_action)
" g:fzf_action keys go through fzf as --expect, so they need the same
" folding as the show key before they can be compared
let actions = map(keys(get(g:, 'fzf_action', s:default_action)),
\ 'get(s:split_keys(v:val), 0, v:val)')
let paste = s:split_keys(s:paste_key())
for key in s:split_keys(a:key)
if has_key(actions, key) || index(paste, key) >= 0 || index(a:claimed, key) >= 0
if index(actions, key) >= 0 || index(paste, key) >= 0 || index(a:claimed, key) >= 0
return 0
endif
endfor