Don't autorevert if minibuffer is active
Some ivy/helm commands allow you to preview buffers, which is not an appropriate time to (invisibly) revert them. The message could be missed and expensive machinary could be triggered (e.g. updating git-gutter), which could appear slow. Best to defer reverting until the user has deliberately landed on the target, and is more likely to notice a revert notification in the minibuffer. Suggested by @flatwhatson
This commit is contained in:
parent
c109acd6fd
commit
70e6c17de5
1 changed files with 6 additions and 6 deletions
|
@ -153,16 +153,16 @@ possible."
|
||||||
;; changes when we switch to a buffer or when we focus the Emacs frame.
|
;; changes when we switch to a buffer or when we focus the Emacs frame.
|
||||||
(defun doom-auto-revert-buffer-h ()
|
(defun doom-auto-revert-buffer-h ()
|
||||||
"Auto revert current buffer, if necessary."
|
"Auto revert current buffer, if necessary."
|
||||||
(unless auto-revert-mode
|
(unless (or auto-revert-mode (active-minibuffer-window))
|
||||||
|
;; Only prompts for confirmation when buffer is unsaved.
|
||||||
(let ((revert-without-query (list ".")))
|
(let ((revert-without-query (list ".")))
|
||||||
(auto-revert-handler))))
|
(auto-revert-handler))))
|
||||||
|
|
||||||
(defun doom-auto-revert-buffers-h ()
|
(defun doom-auto-revert-buffers-h ()
|
||||||
"Auto revert's stale buffers (that are visible)."
|
"Auto revert stale buffers in visible windows, if necessary."
|
||||||
(unless auto-revert-mode
|
(dolist (buf (doom-visible-buffers))
|
||||||
(dolist (buf (doom-visible-buffers))
|
(with-current-buffer buf
|
||||||
(with-current-buffer buf
|
(doom-auto-revert-buffer-h)))))
|
||||||
(doom-auto-revert-buffer-h))))))
|
|
||||||
|
|
||||||
|
|
||||||
(use-package! recentf
|
(use-package! recentf
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue