clarified remove_overlay: always flush in order to make sure that apply_query can make a fresh start with the same arguments (see also 6e69f9ca8f1c) -- NB: print functions are idempotent;
authorwenzelm
Mon, 07 Oct 2013 12:28:19 +0200
changeset 54310 6ddeb83eb67a
parent 54309 626e42d9b9ed
child 54311 ed839b74ef67
clarified remove_overlay: always flush in order to make sure that apply_query can make a fresh start with the same arguments (see also 6e69f9ca8f1c) -- NB: print functions are idempotent;
src/Pure/PIDE/query_operation.scala
--- a/src/Pure/PIDE/query_operation.scala	Fri Oct 04 14:35:00 2013 +0200
+++ b/src/Pure/PIDE/query_operation.scala	Mon Oct 07 12:28:19 2013 +0200
@@ -53,8 +53,12 @@
 
   private def remove_overlay()
   {
-    current_location.foreach(command =>
-      editor.remove_overlay(command, operation_name, instance :: current_query))
+    current_location match {
+      case None =>
+      case Some(command) =>
+        editor.remove_overlay(command, operation_name, instance :: current_query)
+        editor.flush()
+    }
   }
 
 
@@ -129,10 +133,8 @@
         if (current_status != new_status) {
           current_status = new_status
           consume_status(new_status)
-          if (new_status == Query_Operation.Status.REMOVED) {
+          if (new_status == Query_Operation.Status.REMOVED)
             remove_overlay()
-            editor.flush()
-          }
         }
       }
     }