1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00

Fix tree-sitter indent preset function (bug#60270)

* lisp/treesit.el (treesit-simple-indent-presets): Fix
prev-adaptive-prefix so it doesn't return nil if the previous line has
no prefix.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.
This commit is contained in:
Yuan Fu 2023-01-16 00:23:47 -08:00
parent 352e41016b
commit 3d1e74c82a
No known key found for this signature in database
GPG Key ID: 56E19BC57664A442
2 changed files with 14 additions and 1 deletions

View File

@ -1152,7 +1152,6 @@ See `treesit-simple-indent-presets'.")
(and (>= (point) comment-start-bol)
adaptive-fill-regexp
(looking-at adaptive-fill-regexp)
(> (match-end 0) (match-beginning 0))
(match-end 0))))))
;; TODO: Document.
(cons 'grand-parent

View File

@ -133,6 +133,20 @@ Name: Multiline Block Comments 4 (bug#60270)
*/
=-=-=
Name: Multiline Block Comments 5 (bug#60270)
=-=
/*
line one
line 2
*/
=-=
/*
line one
line 2
*/
=-=-=
Code:
(lambda ()