]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix comment-end in treesit-simple-indent-presets
authorYuan Fu <casouri@gmail.com>
Fri, 25 Nov 2022 22:24:27 +0000 (14:24 -0800)
committerYuan Fu <casouri@gmail.com>
Sat, 26 Nov 2022 03:00:22 +0000 (19:00 -0800)
* lisp/treesit.el (treesit-simple-indent-presets): Fix comment-end.

lisp/treesit.el

index 8a8f6f02c79311dab9196f29af938e9373c11fce..b7da38becc120cd5b5e59f05bf4b48988b8d133f 100644 (file)
@@ -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))