1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-06 09:43:13 +02:00

core: consider all keys are safe in cursor context (closes #2244)

This commit is contained in:
Sébastien Helleu
2025-04-04 18:52:58 +02:00
parent ea90809e6c
commit 5ccbdca0c9
2 changed files with 11 additions and 10 deletions
+10 -10
View File
@@ -1215,12 +1215,12 @@ gui_key_set_score (struct t_gui_key *key)
}
/*
* Checks if a key is safe or not: a safe key begins always with the "meta" or
* "ctrl" code (except "@" allowed in cursor/mouse contexts).
* Checks if a key is safe or not: a safe key should begin with the "meta" or
* "ctrl" code (there are exceptions).
*
* Returns:
* 1: key is safe
* 0: key is NOT safe
* 1: key is safe for the given context
* 0: key is NOT safe for the given context
*/
int
@@ -1231,13 +1231,13 @@ gui_key_is_safe (int context, const char *key)
if (!key || !key[0])
return 0;
/* "@" is allowed at beginning for cursor/mouse contexts */
if ((key[0] == '@')
&& ((context == GUI_KEY_CONTEXT_CURSOR)
|| (context == GUI_KEY_CONTEXT_MOUSE)))
{
/* all keys are safe in cursor mode */
if (context == GUI_KEY_CONTEXT_CURSOR)
return 1;
/* "@" is allowed at beginning for mouse context */
if ((key[0] == '@') && (context == GUI_KEY_CONTEXT_MOUSE))
return 1;
}
if (strncmp (key, "comma", 5) == 0)
return 0;