mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2026-09-10 07:46:51 -04:00
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:
parent
32025c709e
commit
062dcd2aea
|
|
@ -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))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue