mirror of
https://github.com/weechat/weechat.git
synced 2026-06-28 05:46:38 +02:00
core: ignore key bindings with empty command
This makes possible to disable a key hiding another (because shorter than the other, and beginning with the same key). For example if key "meta-a" is set to an empty command, it would not hide any more the key "meta-a,1" which has a non-empty command.
This commit is contained in:
@@ -15,6 +15,7 @@ For a list of important changes that require manual actions, please look at rele
|
||||
|
||||
New features::
|
||||
|
||||
* core: ignore key bindings with empty command
|
||||
* core: add support of quotes in commands `/key bind` and `/key bindctxt`
|
||||
* core: evaluate command given to `/repeat` with contextual variables (issue #2007)
|
||||
* core: add option `callbacks` in command `/debug`
|
||||
|
||||
@@ -1653,6 +1653,10 @@ gui_key_search_part (struct t_gui_buffer *buffer, int context,
|
||||
for (ptr_key = (buffer) ? buffer->keys : gui_keys[context]; ptr_key;
|
||||
ptr_key = ptr_key->next_key)
|
||||
{
|
||||
/* ignore keys with no command */
|
||||
if (!ptr_key->command || !ptr_key->command[0])
|
||||
continue;
|
||||
|
||||
if (ptr_key->key
|
||||
&& ((context != GUI_KEY_CONTEXT_CURSOR)
|
||||
|| (ptr_key->key[0] != '@')))
|
||||
|
||||
Reference in New Issue
Block a user