all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: nvp <noah.v.peart@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, 66431@debbugs.gnu.org
Subject: bug#66431: [PATCH] Fix reset treesit--explorer-last-node when explorer buffer was killed
Date: Sat, 21 Oct 2023 11:33:20 -0700	[thread overview]
Message-ID: <EF1DF2B2-73FD-41E0-92AD-ABFD32B7FF70@gmail.com> (raw)
In-Reply-To: <CAPVBTSeCXZmC=RvS1beYdMKnXrHPFyS1qP+RV+BiiydNcrpOng@mail.gmail.com>



> On Oct 20, 2023, at 2:22 PM, nvp <noah.v.peart@gmail.com> wrote:
> 
> That fixes the problem!
> 
> However, the reason I initially put the reset inside the `(unless (buffer-live-p treesit--explorer-buffer) ...)`
> in `treesit-explore-mode` was b/c it looked like there was an optimization happening in 
> `treesit--explorer-refresh` where it does this check 
> 
>            ;; If we didn't edit the buffer nor change the top-level
>            ;; node, don't redraw the whole syntax tree.
>            (highlight-only (treesit-node-eq
>                             top-level treesit--explorer-last-node))
> 
> I don't know if that is something you'd want to keep, but just pointing it out in case.  I think
> the initial patch works as well, but still allows that check to work when the explorer buffer hasn't 
> been killed.

Oh that’s fine, treesit-explore-mode always wipes everything and start from a clean slate. That optimization is for when the user moves point in the source buffer when explore-mode is on. If you’d like to send a patch that does roughly what I did in the patch I sent, I’d love to merge it. Otherwise I can fix it myself, too.

The initial patch could be a bit confusing to the readers since it sets last-node twice, and it’s not clear why.

Thanks,
Yuan




  reply	other threads:[~2023-10-21 18:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-10  6:02 bug#66431: [PATCH] Fix reset treesit--explorer-last-node when explorer buffer was killed nvp
2023-10-14  8:17 ` Eli Zaretskii
2023-10-14 17:08   ` Yuan Fu
2023-10-15  4:20     ` nvp
2023-10-19  4:35       ` Yuan Fu
2023-10-20 21:22         ` nvp
2023-10-21 18:33           ` Yuan Fu [this message]
2023-10-22  0:40             ` nvp
2023-10-22  3:35               ` Yuan Fu
2023-10-14 17:08 ` Yuan Fu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=EF1DF2B2-73FD-41E0-92AD-ABFD32B7FF70@gmail.com \
    --to=casouri@gmail.com \
    --cc=66431@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=noah.v.peart@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.