From 9e7a5d58eea664b55e11f2ea5dc7da9ba26d500f Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Tue, 17 Jan 2023 01:20:51 -0800 Subject: [PATCH] ; Fix tree-sitter indent anchor preset * lisp/treesit.el: (treesit-simple-indent-presets): Fix prev-adaptive-prefix. --- lisp/treesit.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/treesit.el b/lisp/treesit.el index 5e6f109531e..4c31ecb0d29 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -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 -- 2.39.2