summaryrefslogtreecommitdiff
path: root/src/gui/curses
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/curses')
-rw-r--r--src/gui/curses/gui-curses-chat.c10
-rw-r--r--src/gui/curses/gui-curses-key.c16
2 files changed, 17 insertions, 9 deletions
diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c
index e28dc92a6..b62dc52ff 100644
--- a/src/gui/curses/gui-curses-chat.c
+++ b/src/gui/curses/gui-curses-chat.c
@@ -1201,12 +1201,15 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line,
ptr_data = (message_with_tags) ?
message_with_tags : line->data->message;
message_with_search = NULL;
- if (window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
+ if ((window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
+ && (window->buffer->text_search_where & GUI_TEXT_SEARCH_IN_MESSAGE)
+ && (!window->buffer->text_search_regex
+ || window->buffer->text_search_regex_compiled))
{
message_with_search = gui_color_emphasize (ptr_data,
window->buffer->input_buffer,
window->buffer->text_search_exact,
- NULL);
+ window->buffer->text_search_regex_compiled);
if (message_with_search)
ptr_data = message_with_search;
}
@@ -1321,8 +1324,7 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line,
/* display marker if line is matching user search */
if (window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
{
- if (gui_line_search_text (line, window->buffer->input_buffer,
- window->buffer->text_search_exact))
+ if (gui_line_search_text (window->buffer, line))
{
gui_window_set_weechat_color (GUI_WINDOW_OBJECTS(window)->win_chat,
GUI_COLOR_CHAT_TEXT_FOUND);
diff --git a/src/gui/curses/gui-curses-key.c b/src/gui/curses/gui-curses-key.c
index 3d632886b..ef0bc7b92 100644
--- a/src/gui/curses/gui-curses-key.c
+++ b/src/gui/curses/gui-curses-key.c
@@ -223,7 +223,9 @@ gui_key_default_bindings (int context)
{
BIND(/* Enter */ "ctrl-M", "/input search_stop");
BIND(/* Enter */ "ctrl-J", "/input search_stop");
- BIND(/* ^R */ "ctrl-R", "/input search_switch_case");
+ BIND(/* m-c */ "meta-c", "/input search_switch_case");
+ BIND(/* ^R */ "ctrl-R", "/input search_switch_regex");
+ BIND(/* tab */ "ctrl-I", "/input search_switch_where");
BIND(/* up */ "meta2-A", "/input search_previous");
BIND(/* down */ "meta2-B", "/input search_next");
}
@@ -433,12 +435,16 @@ gui_key_flush (int paste)
|| (strcmp (input_old, gui_current_window->buffer->input_buffer) != 0)))
{
/*
- * if current input is longer than old input, and that
- * beginning of current input is exactly equal to old input,
- * then do nothing (search will not find any result and can
- * take some time on buffer with many lines..)
+ * if following conditions are all true, then do not search
+ * again (search will not find any result and can take some time
+ * on a buffer with many lines):
+ * - old search was not successful
+ * - searching a string (not a regex)
+ * - current input is longer than old input
+ * - beginning of current input is exactly equal to old input.
*/
if (!gui_current_window->buffer->text_search_found
+ && !gui_current_window->buffer->text_search_regex
&& (input_old != NULL)
&& (input_old[0])
&& (gui_current_window->buffer->input_buffer != NULL)