summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-07-22 18:07:22 +0200
committerSebastien Helleu <flashcode@flashtux.org>2009-07-22 18:07:22 +0200
commit5139fdcf2a3bb720184deecd121adae561bf4407 (patch)
tree5a0f0b28c9935f195781ea49be4acb1a7b122735 /src
parent232804f29395c48d1661233d3ab868fc8831adeb (diff)
downloadweechat-5139fdcf2a3bb720184deecd121adae561bf4407.zip
Add new option weechat.look.search_text_not_found_alert
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-config.c6
-rw-r--r--src/core/wee-config.h1
-rw-r--r--src/gui/gui-window.c7
3 files changed, 14 insertions, 0 deletions
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 0515cfbd2..46cf00693 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -99,6 +99,7 @@ struct t_config_option *config_look_save_config_on_exit;
struct t_config_option *config_look_save_layout_on_exit;
struct t_config_option *config_look_scroll_amount;
struct t_config_option *config_look_scroll_page_percent;
+struct t_config_option *config_look_search_text_not_found_alert;
struct t_config_option *config_look_set_title;
/* config, colors section */
@@ -1409,6 +1410,11 @@ config_weechat_init_options ()
N_("percent of screen to scroll when scrolling one page up or down "
"(for example 100 means one page, 50 half-page)"),
NULL, 1, 100, "100", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
+ config_look_search_text_not_found_alert = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "search_text_not_found_alert", "boolean",
+ N_("alert user when text sought is not found in buffer"),
+ NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_set_title = config_file_new_option (
weechat_config_file, ptr_section,
"set_title", "boolean",
diff --git a/src/core/wee-config.h b/src/core/wee-config.h
index 2a9530c4b..0908e68e1 100644
--- a/src/core/wee-config.h
+++ b/src/core/wee-config.h
@@ -114,6 +114,7 @@ extern struct t_config_option *config_look_save_config_on_exit;
extern struct t_config_option *config_look_save_layout_on_exit;
extern struct t_config_option *config_look_scroll_amount;
extern struct t_config_option *config_look_scroll_page_percent;
+extern struct t_config_option *config_look_search_text_not_found_alert;
extern struct t_config_option *config_look_set_title;
extern struct t_config_option *config_color_separator;
diff --git a/src/gui/gui-window.c b/src/gui/gui-window.c
index d039c8520..55d539ee0 100644
--- a/src/gui/gui-window.c
+++ b/src/gui/gui-window.c
@@ -889,7 +889,14 @@ gui_window_search_restart (struct t_gui_window *window)
if (gui_window_search_text (window))
window->buffer->text_search_found = 1;
else
+ {
+ if (CONFIG_BOOLEAN(config_look_search_text_not_found_alert)
+ && window->buffer->input_buffer && window->buffer->input_buffer[0])
+ {
+ printf ("\a");
+ }
gui_buffer_ask_chat_refresh (window->buffer, 2);
+ }
}
/*