branch: externals/phpinspect
commit 85695539812386a15eeb54485cf0f4eceb36b494
Author: Hugo Thunnissen <de...@hugot.nl>
Commit: Hugo Thunnissen <de...@hugot.nl>

    Use inhibit-quit to prevent interruption of index updates
---
 phpinspect-buffer.el | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/phpinspect-buffer.el b/phpinspect-buffer.el
index abc81ec723..3bdaa5c95d 100644
--- a/phpinspect-buffer.el
+++ b/phpinspect-buffer.el
@@ -419,16 +419,19 @@ linked with."
   (phpinspect-buffer-parse buffer 'no-interrupt))
 
 (cl-defmethod phpinspect-buffer-update-project-index ((buffer 
phpinspect-buffer))
-  (when (phpinspect-buffer-project buffer)
-    (let ((map (phpinspect-buffer-map buffer)))
-      (unless (eq map (phpinspect-buffer--last-indexed-bmap buffer))
-        (phpinspect-buffer-index-imports buffer (phpinspect-bmap-imports map))
-        (phpinspect-buffer-index-declarations buffer 
(phpinspect-bmap-declarations map))
-        (phpinspect-buffer-index-namespaces buffer (phpinspect-bmap-namespaces 
map))
-        (phpinspect-buffer-index-classes buffer (phpinspect-bmap-classes map))
-        (phpinspect-buffer-index-functions buffer (phpinspect-bmap-functions 
map))
-        (phpinspect-buffer-index-class-variables buffer 
(phpinspect-bmap-class-variables map))
-        (setf (phpinspect-buffer--last-indexed-bmap buffer) map)))))
+  ;; Use inhibit-quit to prevent index corruption though partial index
+  ;; application.
+  (let ((inhibit-quit t))
+    (when (phpinspect-buffer-project buffer)
+      (let ((map (phpinspect-buffer-map buffer)))
+        (unless (eq map (phpinspect-buffer--last-indexed-bmap buffer))
+          (phpinspect-buffer-index-imports buffer (phpinspect-bmap-imports 
map))
+          (phpinspect-buffer-index-declarations buffer 
(phpinspect-bmap-declarations map))
+          (phpinspect-buffer-index-namespaces buffer 
(phpinspect-bmap-namespaces map))
+          (phpinspect-buffer-index-classes buffer (phpinspect-bmap-classes 
map))
+          (phpinspect-buffer-index-functions buffer (phpinspect-bmap-functions 
map))
+          (phpinspect-buffer-index-class-variables buffer 
(phpinspect-bmap-class-variables map))
+          (setf (phpinspect-buffer--last-indexed-bmap buffer) map))))))
 
 (defsubst phpinspect-buffer-parse-map (buffer)
   (phpinspect-buffer-parse buffer)

Reply via email to