branch: externals/vundo
commit d09448aa537a63e35a4bc6b38ceb2c168e891342
Author: Yuan Fu <caso...@gmail.com>
Commit: Yuan Fu <caso...@gmail.com>

    Incrementally refresh vundo buffer in popup-mode
    
    * vundo-popup.el (vundo--popup-advice): Instead of calling
    vundo, which calls for a full vundo--refresh-buffer everytime,
    use vundo--refresh-buffer directly and do a incremental refresh.
    This is much faster.
---
 vundo-popup.el | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/vundo-popup.el b/vundo-popup.el
index ada17b4bcf..15183130b2 100644
--- a/vundo-popup.el
+++ b/vundo-popup.el
@@ -120,14 +120,19 @@ nil means to use the default.  Only effects popups 
created by
   (unless (funcall vundo-prevent-popup-predicate)
     (let ((buffer-read-only buffer-read-only) ;this would be set by `vundo'
           (cb (current-buffer)))
-      (save-selected-window
-        (vundo)
-        (with-current-buffer cb
-          (setq-local vundo-popup-window (selected-window))
-          (funcall
-           (or vundo-remove-popup-win-fun
-               (setq-local vundo-remove-popup-win-fun
-                           (vundo-trigger-delete-popup-win-fun cb)))))))
+      (if (and vundo-popup-window (window-live-p vundo-popup-window))
+          (with-selected-window vundo-popup-window
+            (vundo--refresh-buffer
+             vundo--orig-buffer (current-buffer) 'incremental))
+        (save-selected-window
+          (vundo)
+          (with-current-buffer cb
+            (setq-local vundo-popup-window (selected-window))
+            (funcall
+             (or vundo-remove-popup-win-fun
+                 (setq-local
+                  vundo-remove-popup-win-fun
+                  (vundo-trigger-delete-popup-win-fun cb))))))))
     (let ((window-min-height ;vundo has a hardcoded 3, IMO too much for an 
auto popup
            (or vundo-popup-window-min-height
                window-min-height)))

Reply via email to