emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 491ee428c08 1/2: Fix treesit-explore-mode (bug#66431)


From: Yuan Fu
Subject: emacs-29 491ee428c08 1/2: Fix treesit-explore-mode (bug#66431)
Date: Sat, 21 Oct 2023 23:40:18 -0400 (EDT)

branch: emacs-29
commit 491ee428c083038a8949f998fb4dd0c9ebb36895
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    Fix treesit-explore-mode (bug#66431)
    
    * lisp/treesit.el (treesit-explore-mode): Reset
    treesit--explorer-last-node before calling treesit--explorer-refresh,
    so that in the rare case described in the bug report, the explorer
    buffer don't show the outdated node.
---
 lisp/treesit.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/treesit.el b/lisp/treesit.el
index c4aba4c3e8d..fa375282d7c 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -2835,13 +2835,13 @@ window."
               (treesit--explorer-tree-mode)))
           (display-buffer treesit--explorer-buffer
                           (cons nil '((inhibit-same-window . t))))
+          (setq-local treesit--explorer-last-node nil)
           (treesit--explorer-refresh)
           ;; Set up variables and hooks.
           (add-hook 'post-command-hook
                     #'treesit--explorer-post-command 0 t)
           (add-hook 'kill-buffer-hook
                     #'treesit--explorer-kill-explorer-buffer 0 t)
-          (setq-local treesit--explorer-last-node nil)
           ;; Tell `desktop-save' to not save explorer buffers.
           (when (boundp 'desktop-modes-not-to-save)
             (unless (memq 'treesit--explorer-tree-mode



reply via email to

[Prev in Thread] Current Thread [Next in Thread]