Skip to content

Commit 8ac214b

Browse files
committed
Suggestion list now binds Ctrl-G conditionally.
Unlike textlist_impl, in suggestionlist_impl any catchall keys are forwarded instead of being eaten. Therefore if Ctrl-G is bound to something other than `abort` suggestionlist_impl should not bind it. This is important for allowing fzf_git.lua to respond to Ctrl-G chords. fzf_git.lua is a port of fzf-git.sh.
1 parent b7e6d74 commit 8ac214b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clink/lib/src/suggestionlist_impl.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ void suggestionlist_impl::bind_input(binder& binder)
231231
binder.bind(m_bind_group, "\\e[$*B", bind_id_suggestionlist_wheeldown, true/*has_params*/);
232232
binder.bind(m_bind_group, "\\e[$*;*M", bind_id_suggestionlist_drag, true/*has_params*/);
233233

234-
binder.bind(m_bind_group, "^g", bind_id_suggestionlist_escape);
234+
int32 type;
235+
if (rl_function_of_keyseq("\x07", rl_get_keymap(), &type) == rl_abort)
236+
binder.bind(m_bind_group, "^g", bind_id_suggestionlist_escape);
235237
if (esc)
236238
binder.bind(m_bind_group, esc, bind_id_suggestionlist_escape);
237239

0 commit comments

Comments
 (0)