summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui-window.c24
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)