[gedit] ViewFrame: delete start_mark when the search box is hidden



commit a709473f921223939951a25796eedcade292579e
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Tue Jan 14 22:20:09 2014 +0100

    ViewFrame: delete start_mark when the search box is hidden
    
    When the search box is hidden, the search may not be finished. If the
    search highlighting is still enabled, when the search is finished, the
    callback must not use the start_mark to move the cursor, because the
    user is maybe editing or looking at some text elsewhere.

 gedit/gedit-view-frame.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gedit/gedit-view-frame.c b/gedit/gedit-view-frame.c
index e7ee65c..2ac109d 100644
--- a/gedit/gedit-view-frame.c
+++ b/gedit/gedit-view-frame.c
@@ -211,6 +211,12 @@ hide_search_widget (GeditViewFrame *frame,
                gedit_view_scroll_to_cursor (frame->priv->view);
        }
 
+       if (frame->priv->start_mark != NULL)
+       {
+               gtk_text_buffer_delete_mark (buffer, frame->priv->start_mark);
+               frame->priv->start_mark = NULL;
+       }
+
        gtk_widget_grab_focus (GTK_WIDGET (frame->priv->view));
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]