Fix c-ts-mode--looking-at-star
Not the topic of bug#60270 but reported in one of the replies. * lisp/progmodes/c-ts-mode.el (c-ts-mode--looking-at-star): Check not the character after point but character after BOL. Otherwise indentation is wrong when point is not at BOL.
This commit is contained in:
parent
1df2826639
commit
757c2c2592
1 changed files with 4 additions and 2 deletions
|
@ -205,11 +205,13 @@ beginning of grandparent."
|
||||||
(treesit-node-parent parent)
|
(treesit-node-parent parent)
|
||||||
parent)))))
|
parent)))))
|
||||||
|
|
||||||
(defun c-ts-mode--looking-at-star (&rest _)
|
(defun c-ts-mode--looking-at-star (_n _p bol &rest _)
|
||||||
"A tree-sitter simple indent matcher.
|
"A tree-sitter simple indent matcher.
|
||||||
Matches if there is a \"*\" after point (ignoring whitespace in
|
Matches if there is a \"*\" after point (ignoring whitespace in
|
||||||
between)."
|
between)."
|
||||||
(looking-at (rx (* (syntax whitespace)) "*")))
|
(save-excursion
|
||||||
|
(goto-char bol)
|
||||||
|
(looking-at (rx (* (syntax whitespace)) "*"))))
|
||||||
|
|
||||||
(defun c-ts-mode--comment-start-after-first-star (_n parent &rest _)
|
(defun c-ts-mode--comment-start-after-first-star (_n parent &rest _)
|
||||||
"A tree-sitter simple indent anchor.
|
"A tree-sitter simple indent anchor.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue