[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 73c94d5a9f 2/5: ; Fix comment-end in treesit-simple-indent-preset
From: |
Yuan Fu |
Subject: |
master 73c94d5a9f 2/5: ; Fix comment-end in treesit-simple-indent-presets |
Date: |
Fri, 25 Nov 2022 22:49:48 -0500 (EST) |
branch: master
commit 73c94d5a9f00a98944516d86e4efcf50e20b2d48
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>
; Fix comment-end in treesit-simple-indent-presets
* lisp/treesit.el (treesit-simple-indent-presets): Fix comment-end.
---
lisp/treesit.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lisp/treesit.el b/lisp/treesit.el
index 8a8f6f02c7..b7da38becc 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -1053,8 +1053,10 @@ See `treesit-simple-indent-presets'.")
(lambda (node &rest _)
(string-match-p
name (or (treesit-node-field-name node) "")))))
- (cons 'comment-end (lambda (&rest _)
- (looking-at-p treesit-comment-end)))
+ (cons 'comment-end (lambda (_node _parent bol &rest _)
+ (save-excursion
+ (goto-char bol)
+ (looking-at-p treesit-comment-end))))
;; TODO: Document.
(cons 'catch-all (lambda (&rest _) t))