]> git.eshelyaron.com Git - emacs.git/commit
Fix c-ts-mode indentation for 2nd line in block comment (bug#60270)
authorYuan Fu <casouri@gmail.com>
Mon, 9 Jan 2023 09:44:44 +0000 (01:44 -0800)
committerYuan Fu <casouri@gmail.com>
Tue, 10 Jan 2023 04:06:05 +0000 (20:06 -0800)
commit28dd60213846a04d3f8c4006bd4ec252bd883ed0
treef6b2fe04fbc0098699d1395945c7f595d099c4f0
parent8a36a0f44aafc10f1d10e23d5371bf19ee344b41
Fix c-ts-mode indentation for 2nd line in block comment (bug#60270)

If the first line is "/*" or "/*   ", indent like this:

/*
   aaa

If the first line is "/*   some text", indent like this:

/*   some text
     aaa

* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles):
(c-ts-mode--looking-at-star): Minor refactor.
(c-ts-mode--comment-2nd-line-matcher)
(c-ts-mode--comment-2nd-line-anchor): New functions.
* lisp/treesit.el (treesit-simple-indent-presets):
prev-adaptive-prefix doesn't handle the comment-start-skip case (i.e,
2nd line) anymore.  (Handled by the new matcher.)
lisp/progmodes/c-ts-mode.el
lisp/treesit.el