fix(dirvish): allow proper buffer switching
This commit is contained in:
parent
d13dd8dc29
commit
8f325d53eb
1 changed files with 23 additions and 0 deletions
23
config.org
23
config.org
|
|
@ -4207,6 +4207,29 @@ If a side session is open, we'll configure =winum= to give it the index ~(popup\
|
|||
(push #'~/winum-dirvish-side winum-assign-functions))
|
||||
#+end_src
|
||||
|
||||
*** Bug Fixes
|
||||
|
||||
**** Buffer Switching
|
||||
|
||||
When a full-frame =dirvish= display is switched out of using ~switch-to-buffer~, the fact that Dirvish's buffer is dedicated prevents the switch from working properly. We can fix this by advising that function to clear the =dirvish= session when necessary.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(defadvice! ~/switch-to-buffer-dirvish-clear (&rest _)
|
||||
:before #'switch-to-buffer
|
||||
(when (featurep 'dirvish)
|
||||
(when-let ((dv (dirvish-curr)))
|
||||
(dirvish--clear-session dv))))
|
||||
|
||||
;;(defadvice! ~/kill-buffer-dirvish-clear (old-fn buffer-or-name)
|
||||
;; :around #'kill-buffer
|
||||
;; (when (featurep 'dirvish)
|
||||
;; (if-let ((dv (dirvish-curr)))
|
||||
;; (dirvish--clear-session dv)
|
||||
;; (if ))))
|
||||
#+end_src
|
||||
|
||||
The optional ~from-quit~ argument on the session clear function is not set, indicating that this switch is not to be treated as a quit-out, and the session will possibly be reused accordingly.
|
||||
|
||||
** Emacs Lisp
|
||||
|
||||
#+call: confpkg("Mode: Emacs Lisp")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue