--- Begin Message ---
Subject: |
29.0.60; `treesit-simple-indent-presets' `prev-line' has incorrect position |
Date: |
Sun, 5 Mar 2023 23:29:59 -0500 |
I'm expecting `prev-line' to return the position of the first non-space
character on the previous line. However, it instead returns the number
of characters skipped on the previous line to move to the first
non-space character (i.e., the result of calling `skip-chars-foward').
It appears there is a missing call to `point' that should appear at the
end of the defined lambda.
(cons 'prev-line (lambda (_n _p bol &rest _)
(save-excursion
(goto-char bol)
(forward-line -1)
- (skip-chars-forward " \t"))))
+ (skip-chars-forward " \t")
+ (point))))
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#61998: 29.0.60; `treesit-simple-indent-presets' `prev-line' has incorrect position |
Date: |
Tue, 7 Mar 2023 16:27:54 -0800 |
Troy Brown <brownts@troybrown.dev> writes:
> I'm expecting `prev-line' to return the position of the first non-space
> character on the previous line. However, it instead returns the number
> of characters skipped on the previous line to move to the first
> non-space character (i.e., the result of calling `skip-chars-foward').
>
> It appears there is a missing call to `point' that should appear at the
> end of the defined lambda.
>
> (cons 'prev-line (lambda (_n _p bol &rest _)
> (save-excursion
> (goto-char bol)
> (forward-line -1)
> - (skip-chars-forward " \t"))))
> + (skip-chars-forward " \t")
> + (point))))
Thanks for the catch! I fixed it on emacs-29.
Yuan
--- End Message ---