diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2013-10-06 11:59:42 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2013-10-06 11:59:42 +0200 |
commit | 07115ef3d0d0fd3cb25ddfa3ff44abb0c3a6d140 (patch) | |
tree | b734c450550fdd46d07c437af7b12e9565926574 /src/gui | |
parent | 7364853c9dfd4c6d4ef6ec0bb85d1609155829ff (diff) | |
download | weechat-07115ef3d0d0fd3cb25ddfa3ff44abb0c3a6d140.zip |
core: add options to customize default text search in buffers
New options:
- weechat.look.buffer_search_case_sensitive (boolean, off by default)
- weechat.look.buffer_search_force_default (boolean, off by default)
- weechat.look.buffer_search_regex (boolean, off by default)
- weechat.look.buffer_search_where (prefix, message (by default), prefix_message)
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/gui-window.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/gui/gui-window.c b/src/gui/gui-window.c index 7e1fc4fb4..c37954c1b 100644 --- a/src/gui/gui-window.c +++ b/src/gui/gui-window.c @@ -1549,8 +1549,28 @@ void gui_window_search_start (struct t_gui_window *window) { window->buffer->text_search = GUI_TEXT_SEARCH_BACKWARD; - if (window->buffer->text_search_where == 0) - window->buffer->text_search_where = GUI_TEXT_SEARCH_IN_MESSAGE; + if ((window->buffer->text_search_where == 0) + || CONFIG_BOOLEAN(config_look_buffer_search_force_default)) + { + /* set default search values */ + window->buffer->text_search_exact = CONFIG_BOOLEAN(config_look_buffer_search_case_sensitive); + window->buffer->text_search_regex = CONFIG_BOOLEAN(config_look_buffer_search_regex); + switch (CONFIG_INTEGER(config_look_buffer_search_where)) + { + case CONFIG_LOOK_BUFFER_SEARCH_PREFIX: + window->buffer->text_search_where = GUI_TEXT_SEARCH_IN_PREFIX; + break; + case CONFIG_LOOK_BUFFER_SEARCH_MESSAGE: + window->buffer->text_search_where = GUI_TEXT_SEARCH_IN_MESSAGE; + break; + case CONFIG_LOOK_BUFFER_SEARCH_PREFIX_MESSAGE: + window->buffer->text_search_where = GUI_TEXT_SEARCH_IN_PREFIX | GUI_TEXT_SEARCH_IN_MESSAGE; + break; + default: + window->buffer->text_search_where = GUI_TEXT_SEARCH_IN_MESSAGE; + break; + } + } window->buffer->text_search_found = 0; gui_input_search_compile_regex (window->buffer); if (window->buffer->text_search_input) |