diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-07-04 14:02:15 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-07-04 14:02:15 +0200 |
commit | 64b52da4064dffb4de83a8f95c43f6ee4eca9cf7 (patch) | |
tree | 3fe8d9b49bd74d97b6ce038b8f0d17f24539151a /src/plugins/typing/typing.c | |
parent | 5ae4af1549b9ec3c160b7d5d1118b3aa38d8e03d (diff) | |
download | weechat-64b52da4064dffb4de83a8f95c43f6ee4eca9cf7.zip |
typing: add option typing.look.input_min_chars
Diffstat (limited to 'src/plugins/typing/typing.c')
-rw-r--r-- | src/plugins/typing/typing.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/typing/typing.c b/src/plugins/typing/typing.c index 003863228..d27fce1d7 100644 --- a/src/plugins/typing/typing.c +++ b/src/plugins/typing/typing.c @@ -102,7 +102,7 @@ typing_input_text_changed_signal_cb (const void *pointer, void *data, const char *signal, const char *type_data, void *signal_data) { - int text_search; + int text_search, input_valid; const char *ptr_input, *ptr_input_for_buffer; struct t_gui_buffer *ptr_buffer; struct t_typing_status *ptr_typing_status; @@ -121,8 +121,10 @@ typing_input_text_changed_signal_cb (const void *pointer, void *data, return WEECHAT_RC_OK; ptr_input = weechat_buffer_get_string (ptr_buffer, "input"); + input_valid = (ptr_input && ptr_input[0]) ? + weechat_utf8_strlen (ptr_input) >= weechat_config_integer (typing_config_look_input_min_chars) : 0; - if (ptr_input && ptr_input[0]) + if (input_valid) { /* input is a command? ignore it */ ptr_input_for_buffer = weechat_string_input_for_buffer (ptr_input); |