Subject: Re: bug#66431: [PATCH] Fix reset treesit--explorer-last-node when explorer buffer was killed

From: Yuan Fu <[email-masked]>
Date: Sat, 14 Oct 2023 10:08:09 -0700

> On Oct 9, 2023, at 11:02 PM, nvp <[email-masked]> wrote:
> 
> Tags: patch
> 
> 
> Bug: After `treesit-explorer-mode` is enabled in a buffer and its
> associated `treesit--explorer-buffer` is killed, a subsequent call
> to `treesit-explorer-mode` initially displays an empty explorer
> buffer b/c `treesit--explorer-refresh` sees old value for
> `treesit--explorer-last-node`.
> 
> * lisp/treesit.el (treesit-explorer-mode): reset
> `treesit--explorer-last-node` when `treesit--explorer-buffer` was killed

Hmm, I can’t reproduce what you described. Besides, treesit--explorer-last-node is only set in the source buffer, not the explorer buffer. But the patch tries to reset it for the explorer buffer. Also treesit--explorer-last-node is reset at the end of treesit-explore-mode.

We can start from reliably reproducing the bug you are seeing, and see what’s the true cause of it.

Yuan