unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: nvp <noah.v.peart@gmail.com>
To: Yuan Fu <casouri@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 17:40:40 -0700	[thread overview]
Message-ID: <CAPVBTSf0tg0CdqO4oQ0NQ7-hfmfQk6Ghjnz5pdWw5c_3ppzM_w@mail.gmail.com> (raw)
In-Reply-To: <EF1DF2B2-73FD-41E0-92AD-ABFD32B7FF70@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1564 bytes --]

Ok that makes sense, thanks for clearing that up for me, your fix looks
good. I'm loving this package!

On Sat, Oct 21, 2023 at 11:33 AM Yuan Fu <casouri@gmail.com> wrote:

>
>
> > 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

[-- Attachment #2: Type: text/html, Size: 2039 bytes --]

  reply	other threads:[~2023-10-22  0:40 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
2023-10-22  0:40             ` nvp [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CAPVBTSf0tg0CdqO4oQ0NQ7-hfmfQk6Ghjnz5pdWw5c_3ppzM_w@mail.gmail.com \
    --to=noah.v.peart@gmail.com \
    --cc=66431@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=eliz@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).