]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix tree-sitter indent preset function (bug#60270)
authorYuan Fu <casouri@gmail.com>
Mon, 16 Jan 2023 08:23:47 +0000 (00:23 -0800)
committerYuan Fu <casouri@gmail.com>
Mon, 16 Jan 2023 08:32:57 +0000 (00:32 -0800)
* lisp/treesit.el (treesit-simple-indent-presets): Fix
prev-adaptive-prefix so it doesn't return nil if the previous line has
no prefix.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.

lisp/treesit.el
test/lisp/progmodes/c-ts-mode-resources/indent.erts

index ffc78b9303273e6fbe2bc390c80f6161ee5c77ad..5e6f109531e0bcdfae65ac134df4c57f26c2ca1b 100644 (file)
@@ -1152,7 +1152,6 @@ See `treesit-simple-indent-presets'.")
                     (and (>= (point) comment-start-bol)
                          adaptive-fill-regexp
                          (looking-at adaptive-fill-regexp)
-                         (> (match-end 0) (match-beginning 0))
                          (match-end 0))))))
         ;; TODO: Document.
         (cons 'grand-parent
index 71524e273f33f7c94d636979cf8830706c67ebdd..70fce68b0ec4bba6226a9a3e4bafef0e622b817f 100644 (file)
@@ -133,6 +133,20 @@ Name: Multiline Block Comments 4 (bug#60270)
  */
 =-=-=
 
+Name: Multiline Block Comments 5 (bug#60270)
+
+=-=
+/*
+line one
+line 2
+ */
+=-=
+/*
+  line one
+  line 2
+ */
+=-=-=
+
 
 Code:
   (lambda ()