From: Juan Palacios <jpalaciosdev@gmail.com>
To: Randy Taylor <dev@rjt.dev>
Cc: Yuan Fu <casouri@gmail.com>, 66845@debbugs.gnu.org
Subject: bug#66845: 29.1; cmake-ts-mode indentation broken
Date: Tue, 7 Nov 2023 21:11:37 +0100 [thread overview]
Message-ID: <CAEPLNsfHtBpV5k1Yge7jPNrhSWEk=oD1pf5eDLquoPiYY6xXBQ@mail.gmail.com> (raw)
In-Reply-To: <KtEjEz2JJBgL_BYUTDSUUENVTfbaPlsmIpdqDPEBihAVEa-my5QOQnys_AKCon1b6ZayHztDJ2lhEt8Da4bu-M-7h1828MX2r8TKzAzq2oo=@rjt.dev>
El mar, 7 nov 2023 a las 18:22, Randy Taylor (<dev@rjt.dev>) escribió:
>
> On Tuesday, November 7th, 2023 at 03:25, Yuan Fu <casouri@gmail.com> wrote:
> > IMO it makes more sense to use prev-sibling:
> >
> > ,@(ignore-errors
> > (treesit-query-capture 'cmake '((body) @capture))
> > `(((parent-is "body") prev-sibling 0)))
> >
> > This would allow users to manually adjust the indentation of a line and have the rest of the body follow that.
>
> This would be much more elegant but unfortunately that and my previous patch failed to account for the following:
>
> 1 if(TRUE) # Comment.
> 2 endif()
>
> And place POINT at the end of line 1 and hit RET. It will indent to the start of the comment :(. However, you gave me an idea: use the grand-parent as the anchor (which in this case is the if - exactly what we want). I've attached a new patch which accounts for that.
>
> Juan, thanks for testing the first patch. Please give this new one a whirl if you're able to.
This patch is working fine.
Thank you!
next prev parent reply other threads:[~2023-11-07 20:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-31 11:35 bug#66845: 29.1; cmake-ts-mode indentation broken Juan Palacios
2023-10-31 15:50 ` Randy Taylor
2023-11-01 2:45 ` Randy Taylor
2023-11-05 14:32 ` Juan Palacios
2023-11-05 18:16 ` Fu Yuan
2023-11-07 8:25 ` Yuan Fu
2023-11-07 17:21 ` Randy Taylor
2023-11-07 20:11 ` Juan Palacios [this message]
2023-11-08 2:52 ` Yuan Fu
2023-11-08 3:42 ` Randy Taylor
2023-11-08 12:33 ` Eli Zaretskii
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='CAEPLNsfHtBpV5k1Yge7jPNrhSWEk=oD1pf5eDLquoPiYY6xXBQ@mail.gmail.com' \
--to=jpalaciosdev@gmail.com \
--cc=66845@debbugs.gnu.org \
--cc=casouri@gmail.com \
--cc=dev@rjt.dev \
/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.