Fix c-ts-mode comment indent
* lisp/progmodes/c-ts-mode.el: (c-ts-mode--comment-2nd-line-matcher): Also make sure PARENT is a comment node.
This commit is contained in:
parent
8377ed5298
commit
55aabfea4a
1 changed files with 5 additions and 4 deletions
|
@ -246,10 +246,11 @@ Assumes PARENT is a comment node."
|
||||||
(defun c-ts-mode--comment-2nd-line-matcher (_n parent &rest _)
|
(defun c-ts-mode--comment-2nd-line-matcher (_n parent &rest _)
|
||||||
"Matches if point is at the second line of a block comment.
|
"Matches if point is at the second line of a block comment.
|
||||||
PARENT should be a comment node."
|
PARENT should be a comment node."
|
||||||
|
(and (equal (treesit-node-type parent) "comment")
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(forward-line -1)
|
(forward-line -1)
|
||||||
(back-to-indentation)
|
(back-to-indentation)
|
||||||
(eq (point) (treesit-node-start parent))))
|
(eq (point) (treesit-node-start parent)))))
|
||||||
|
|
||||||
(defun c-ts-mode--comment-2nd-line-anchor (&rest _)
|
(defun c-ts-mode--comment-2nd-line-anchor (&rest _)
|
||||||
"Return appropriate anchor for the second line of a comment.
|
"Return appropriate anchor for the second line of a comment.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue