branch: externals/vundo commit 30f85b4ae1f2a7189d44bb738b49559928d046cb Author: Michael Heerdegen <michael_heerde...@web.de> Commit: Yuan Fu <caso...@gmail.com>
vundo as popup for normal undo/redo (issue #114) * vundo-popup.el (vundo--popup-advice): Refresh the "close the window after N seconds" timer after performing the incremental refresh. That leads to the window being closed in the middle of undo-redo operations. --- vundo-popup.el | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/vundo-popup.el b/vundo-popup.el index 15183130b2..dce4f2ac8c 100644 --- a/vundo-popup.el +++ b/vundo-popup.el @@ -117,26 +117,26 @@ nil means to use the default. Only effects popups created by (defun vundo--popup-advice (&rest _args) "Popup vundo window after executing the advised command." - (unless (funcall vundo-prevent-popup-predicate) - (let ((buffer-read-only buffer-read-only) ;this would be set by `vundo' - (cb (current-buffer))) - (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))) - (fit-window-to-buffer vundo-popup-window vundo-window-max-height)))) + (let ((cb (current-buffer))) + (if (window-live-p vundo-popup-window) + (with-selected-window vundo-popup-window + (vundo--refresh-buffer + vundo--orig-buffer (current-buffer) 'incremental)) + (unless (funcall vundo-prevent-popup-predicate) + (let ((buffer-read-only buffer-read-only)) ;this would be set by `vundo' + (save-selected-window + (vundo) + (with-current-buffer cb + (setq-local vundo-popup-window (selected-window))) + (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))) + (fit-window-to-buffer vundo-popup-window vundo-window-max-height)))))) + (funcall + (or vundo-remove-popup-win-fun + (setq-local + vundo-remove-popup-win-fun + (vundo-trigger-delete-popup-win-fun cb)))))) ;;;###autoload (define-minor-mode vundo-popup-mode