diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2012-07-05 16:06:28 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2012-07-05 16:06:28 +0200 |
commit | 3de7b2ff3d097ba779f544620552852b7939b511 (patch) | |
tree | 25904a33388da8bf7b574d39ed46980972c9f9a8 /src/plugins/aspell/weechat-aspell-config.c | |
parent | cbc47ece3d717b4acd9fe3e5b4c435b5ccc5ffc5 (diff) | |
download | weechat-3de7b2ff3d097ba779f544620552852b7939b511.zip |
aspell: add new option aspell.check.enabled, add options enable/disable/toggle for command /aspell, display aspell status with /aspell (task #11988)
New options in command /aspell:
- "enable": enable aspell
- "disable": disable aspell
- "toggle": toggle aspell
Options renamed in command /aspell:
- "enable" renamed to "setdict" (set dictionary for current buffer)
- "disable" renamed to "deldict" (delete dictionary used on current buffer)
- "dictlist" renamed to "listdict" (show installed dictionaries)
Diffstat (limited to 'src/plugins/aspell/weechat-aspell-config.c')
-rw-r--r-- | src/plugins/aspell/weechat-aspell-config.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/plugins/aspell/weechat-aspell-config.c b/src/plugins/aspell/weechat-aspell-config.c index 0dd7c808e..0451810f8 100644 --- a/src/plugins/aspell/weechat-aspell-config.c +++ b/src/plugins/aspell/weechat-aspell-config.c @@ -44,6 +44,7 @@ struct t_config_option *weechat_aspell_config_look_color; struct t_config_option *weechat_aspell_config_check_commands; struct t_config_option *weechat_aspell_config_check_default_dict; struct t_config_option *weechat_aspell_config_check_during_search; +struct t_config_option *weechat_aspell_config_check_enabled; struct t_config_option *weechat_aspell_config_check_real_time; struct t_config_option *weechat_aspell_config_check_word_min_length; @@ -116,6 +117,22 @@ weechat_aspell_config_change_default_dict (void *data, } /* + * weechat_aspell_config_change_enabled: called when aspell state is changed + */ + +void +weechat_aspell_config_change_enabled (void *data, struct t_config_option *option) +{ + /* make C compiler happy */ + (void) data; + + aspell_enabled = weechat_config_boolean (option); + + /* refresh input */ + weechat_bar_item_update ("input_text"); +} + +/* * weechat_aspell_config_dict_change: called when a dictionary is changed */ @@ -423,6 +440,12 @@ weechat_aspell_config_init () "during_search", "boolean", N_("check words during text search in buffer"), NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + weechat_aspell_config_check_enabled = weechat_config_new_option ( + weechat_aspell_config_file, ptr_section, + "enabled", "boolean", + N_("enable aspell check for command line"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, &weechat_aspell_config_change_enabled, NULL, NULL, NULL); weechat_aspell_config_check_real_time = weechat_config_new_option ( weechat_aspell_config_file, ptr_section, "real_time", "boolean", |