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

api: add support of prefix "quiet:" in function key_unbind() to quietly remove keys

This commit is contained in:
Sébastien Helleu
2017-10-24 23:03:40 +02:00
parent 759ccc328f
commit fe73a38b58
6 changed files with 30 additions and 14 deletions
+11 -4
View File
@@ -927,6 +927,15 @@ gui_key_unbind_plugin (const char *context, const char *key)
if (ctxt < 0)
return 0;
if (strncmp (key, "quiet:", 6) == 0)
{
key += 6;
}
else
{
gui_key_verbose = 1;
}
if (strncmp (key, "area:", 5) == 0)
{
num_keys = 0;
@@ -944,9 +953,7 @@ gui_key_unbind_plugin (const char *context, const char *key)
&& ptr_key->area_name[1]
&& (strcmp (ptr_key->area_name[1], area_name) == 0)))
{
gui_key_verbose = 1;
num_keys += gui_key_unbind (NULL, ctxt, ptr_key->key);
gui_key_verbose = 0;
}
}
free (area_name);
@@ -954,11 +961,11 @@ gui_key_unbind_plugin (const char *context, const char *key)
}
else
{
gui_key_verbose = 1;
num_keys = gui_key_unbind (NULL, ctxt, key);
gui_key_verbose = 0;
}
gui_key_verbose = 0;
return num_keys;
}