[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#66845: 29.1; cmake-ts-mode indentation broken
From: |
Juan Palacios |
Subject: |
bug#66845: 29.1; cmake-ts-mode indentation broken |
Date: |
Tue, 7 Nov 2023 21:11:37 +0100 |
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!