diff options
author | cadmio <gioresta87@gmail.com> | 2023-11-07 17:10:07 +0100 |
---|---|---|
committer | cadmio <gioresta87@gmail.com> | 2023-11-07 17:10:07 +0100 |
commit | bcf86a5af369aeabc2866458ae8032e2c82a4824 (patch) | |
tree | 719223b5b3444aad1c449dfa73534aaba1637a5f | |
parent | 9b7a61a2d4ac227bf4dab95fc269532668671964 (diff) | |
download | litos4-bcf86a5af369aeabc2866458ae8032e2c82a4824.tar.gz litos4-bcf86a5af369aeabc2866458ae8032e2c82a4824.tar.bz2 litos4-bcf86a5af369aeabc2866458ae8032e2c82a4824.zip |
update all
-rw-r--r-- | litosappwin.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/litosappwin.c b/litosappwin.c index 62810c9..7b6f700 100644 --- a/litosappwin.c +++ b/litosappwin.c @@ -103,17 +103,32 @@ next_match(GtkWidget *close_btn, gpointer user_data) if (win->search_context != NULL) { + GtkTextMark* mark; GtkSourceBuffer *buffer; GtkTextIter start, match_start, match_end; + GtkSourceView *view = currentTabSourceView(win); buffer = gtk_source_search_context_get_buffer (win->search_context); - + gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (buffer), &match_start, &start); gtk_source_search_context_forward (win->search_context, &start, &match_start, &match_end, FALSE); + GtkSourceView *source_view = currentTabSourceView(win); + + mark = gtk_text_buffer_get_insert(GTK_TEXT_BUFFER(buffer)); + + gtk_text_view_scroll_to_mark ( + GTK_TEXT_VIEW(view), + mark, + 0, + FALSE, + 0.0, + 0.0 + ); + gtk_text_buffer_select_range (GTK_TEXT_BUFFER (buffer), &match_start, &match_end); } } @@ -160,6 +175,15 @@ search_text_changed (GtkEntry *entry, mark = gtk_text_buffer_get_insert(buffer); + gtk_text_view_scroll_to_mark ( + GTK_TEXT_VIEW(view), + mark, + 0, + FALSE, + 0.0, + 0.0 + ); + /* Very simple-minded search implementation */ gtk_text_buffer_get_start_iter (buffer, &start); |