summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/gui-input.c4
-rw-r--r--src/gui/gui-window.c29
-rw-r--r--src/gui/gui-window.h4
3 files changed, 9 insertions, 28 deletions
diff --git a/src/gui/gui-input.c b/src/gui/gui-input.c
index d052429d1..a635c021f 100644
--- a/src/gui/gui-input.c
+++ b/src/gui/gui-input.c
@@ -578,7 +578,7 @@ gui_input_search_text_here (struct t_gui_buffer *buffer)
window = gui_window_search_with_buffer (buffer);
if (window && (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED))
{
- gui_window_search_start_here (window);
+ gui_window_search_start (window, window->scroll->start_line);
gui_input_search_signal (buffer);
}
}
@@ -595,7 +595,7 @@ gui_input_search_text (struct t_gui_buffer *buffer)
window = gui_window_search_with_buffer (buffer);
if (window && (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED))
{
- gui_window_search_start (window);
+ gui_window_search_start (window, NULL);
gui_input_search_signal (buffer);
}
}
diff --git a/src/gui/gui-window.c b/src/gui/gui-window.c
index 83534dc80..825fd47ba 100644
--- a/src/gui/gui-window.c
+++ b/src/gui/gui-window.c
@@ -1569,12 +1569,15 @@ gui_window_search_text (struct t_gui_window *window)
}
/*
- * Begins search in a buffer (helper function).
+ * Starts search in a buffer at a given position
+ * (or in whole buffer if text_search_start_line is NULL).
*/
void
-gui_window_search_begin (struct t_gui_window *window)
+gui_window_search_start (struct t_gui_window *window,
+ struct t_gui_line *text_search_start_line)
{
+ window->scroll->text_search_start_line = text_search_start_line;
window->buffer->text_search =
(window->buffer->type == GUI_BUFFER_TYPE_FORMATTED) ?
GUI_TEXT_SEARCH_BACKWARD : GUI_TEXT_SEARCH_FORWARD;
@@ -1621,28 +1624,6 @@ gui_window_search_begin (struct t_gui_window *window)
}
/*
- * Starts search in a buffer at current position.
- */
-
-void
-gui_window_search_start_here (struct t_gui_window *window)
-{
- gui_window_search_begin (window);
- window->scroll->text_search_start_line = window->scroll->start_line;
-}
-
-/*
- * Starts search in a buffer.
- */
-
-void
-gui_window_search_start (struct t_gui_window *window)
-{
- gui_window_search_begin (window);
- window->scroll->text_search_start_line = NULL;
-}
-
-/*
* Restarts search (after input changes or exact flag (un)set).
*/
diff --git a/src/gui/gui-window.h b/src/gui/gui-window.h
index 4f64bf993..f0f9387ec 100644
--- a/src/gui/gui-window.h
+++ b/src/gui/gui-window.h
@@ -183,8 +183,8 @@ extern void gui_window_scroll_horiz (struct t_gui_window *window, char *scroll);
extern void gui_window_scroll_previous_highlight (struct t_gui_window *window);
extern void gui_window_scroll_next_highlight (struct t_gui_window *window);
extern void gui_window_scroll_unread (struct t_gui_window *window);
-extern void gui_window_search_start_here (struct t_gui_window *window);
-extern void gui_window_search_start (struct t_gui_window *window);
+extern void gui_window_search_start (struct t_gui_window *window,
+ struct t_gui_line *text_search_start_line);
extern void gui_window_search_restart (struct t_gui_window *window);
extern void gui_window_search_stop_here (struct t_gui_window *window);
extern void gui_window_search_stop (struct t_gui_window *window);