From d9aba33eaa860dd1bd30bfc4ae7a81b8d0a008b6 Mon Sep 17 00:00:00 2001 From: Abe Binder Date: Mon, 16 Feb 2026 11:37:05 -1000 Subject: [PATCH] Do not jump to search match when sourcing search string from selected text. --- xed/xed-searchbar.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xed/xed-searchbar.c b/xed/xed-searchbar.c index 89ec4f00..80fee347 100644 --- a/xed/xed-searchbar.c +++ b/xed/xed-searchbar.c @@ -45,6 +45,7 @@ struct _XedSearchbarPrivate XedSearchMode search_mode; guint update_occurrence_count_id; + gboolean skip_jump_to_match; }; G_DEFINE_TYPE_WITH_PRIVATE (XedSearchbar, xed_searchbar, GTK_TYPE_BOX) @@ -379,7 +380,11 @@ do_find (XedSearchbar *searchbar, g_object_unref (search_context); } - if (search_backwards) + if (searchbar->priv->skip_jump_to_match) + { + searchbar->priv->skip_jump_to_match = FALSE; + } + else if (search_backwards) { run_backward_search (searchbar->window); } @@ -812,6 +817,7 @@ xed_searchbar_show (XedSearchbar *searchbar, escaped_find_text = gtk_source_utils_escape_search_text (find_text); } + searchbar->priv->skip_jump_to_match = TRUE; xed_searchbar_set_search_text (XED_SEARCHBAR (searchbar), escaped_find_text); g_free (escaped_find_text);