Fix prev-adaptive-prefix anchor (bug#61314)

* lisp/treesit.el (treesit-simple-indent-presets):
Replace (match-beginning 1) with (skip-syntax-forward "-"), both
returns the position of the beginning of the prefix, but
skip-syntax-forward always works regardless whether
adaptive-fill-regexp has a match group for the prefix.
This commit is contained in:
Yuan Fu 2026-08-16 23:27:03 -07:00 committed by Eli Zaretskii
parent 32025c709e
commit 062dcd2aea

View file

@ -2559,9 +2559,11 @@ as the anchor.")
;; has a prefix, indent to the beginning of
;; prev line's prefix rather than the end of
;; prev line's prefix. (Bug#61314).
(or (and this-line-has-prefix
(match-beginning 1))
(match-end 0)))))))
(if this-line-has-prefix
(progn
(skip-syntax-forward "-")
(point))
(match-end 0)))))))
(cons 'grand-parent
(lambda (_n parent &rest _)
(treesit-node-start (treesit-node-parent parent))))