[latexila] Search: block interactive completion during replace



commit a1217964e626e0705342247aa241f960c2294f6a
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Tue Oct 8 00:55:52 2013 +0200

    Search: block interactive completion during replace
    
    It should be done by GtkSourceView, but in gsv, the buffer doesn't know
    the list of views using the buffer. And the completion is accessible via
    the view. So for now it is done by the application.

 src/search.vala |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/search.vala b/src/search.vala
index e16ca0b..da6f534 100644
--- a/src/search.vala
+++ b/src/search.vala
@@ -261,6 +261,8 @@ public class SearchAndReplace : GLib.Object
         {
             if (_search_context != null)
             {
+                _main_window.active_view.completion.block_interactive ();
+
                 try
                 {
                     _search_context.replace_all (_entry_replace.text, -1);
@@ -269,6 +271,8 @@ public class SearchAndReplace : GLib.Object
                 {
                     /* Do nothing. An error can occur only for a regex search. */
                 }
+
+                _main_window.active_view.completion.unblock_interactive ();
             }
         });
 
@@ -518,6 +522,8 @@ public class SearchAndReplace : GLib.Object
         SourceBuffer buffer = _search_context.get_buffer ();
         buffer.get_selection_bounds (out match_start, out match_end);
 
+        _main_window.active_view.completion.block_interactive ();
+
         try
         {
             if (! _search_context.replace (match_start, match_end,
@@ -528,5 +534,7 @@ public class SearchAndReplace : GLib.Object
         {
             /* Do nothing. An error can occur only for a regex search. */
         }
+
+        _main_window.active_view.completion.unblock_interactive ();
     }
 }


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