]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix tree-sitter indent anchor preset
authorYuan Fu <casouri@gmail.com>
Tue, 17 Jan 2023 09:20:51 +0000 (01:20 -0800)
committerYuan Fu <casouri@gmail.com>
Tue, 17 Jan 2023 09:20:51 +0000 (01:20 -0800)
* lisp/treesit.el:
(treesit-simple-indent-presets): Fix prev-adaptive-prefix.

lisp/treesit.el

index 5e6f109531e0bcdfae65ac134df4c57f26c2ca1b..4c31ecb0d292bde12d3ce2f7eaa6f037714b161b 100644 (file)
@@ -1152,6 +1152,9 @@ See `treesit-simple-indent-presets'.")
                     (and (>= (point) comment-start-bol)
                          adaptive-fill-regexp
                          (looking-at adaptive-fill-regexp)
+                         ;; If previous line is an empty line, don't
+                         ;; indent.
+                         (not (looking-at (rx (* whitespace) eol)))
                          (match-end 0))))))
         ;; TODO: Document.
         (cons 'grand-parent