diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-09-17 10:44:21 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-09-17 10:44:21 +0200 |
commit | a99fc17d400b9931bdcbc49c53ab7ea4501a2306 (patch) | |
tree | 330f1f22f286343b0daee41781249b5c7e04b797 /src/plugins/spell/spell-speller.c | |
parent | 2b2ba62600562d93f974bf7d0bd9db3b804ee22b (diff) | |
download | weechat-a99fc17d400b9931bdcbc49c53ab7ea4501a2306.zip |
spell: allow special dict value "-" to disable spell checking on a specific buffer (closes #1699)
Diffstat (limited to 'src/plugins/spell/spell-speller.c')
-rw-r--r-- | src/plugins/spell/spell-speller.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/spell/spell-speller.c b/src/plugins/spell/spell-speller.c index f8662e0ca..3b3229a27 100644 --- a/src/plugins/spell/spell-speller.c +++ b/src/plugins/spell/spell-speller.c @@ -97,6 +97,13 @@ spell_speller_check_dictionaries (const char *dict_list) char **argv; int argc, i; + if (!dict_list) + return; + + /* special value "-" is used to disable spell checking on a buffer */ + if (strcmp (dict_list, "-") == 0) + return; + if (dict_list) { argv = weechat_string_split (dict_list, ",", NULL, @@ -381,7 +388,7 @@ spell_speller_buffer_new (struct t_gui_buffer *buffer) new_speller_buffer->modifier_result = NULL; buffer_dicts = spell_get_dict (buffer); - if (buffer_dicts) + if (buffer_dicts && (strcmp (buffer_dicts, "-") != 0)) { dicts = weechat_string_split (buffer_dicts, ",", NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT |