emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 3d1e74c82a: Fix tree-sitter indent preset function (bug#60270)


From: Yuan Fu
Subject: emacs-29 3d1e74c82a: Fix tree-sitter indent preset function (bug#60270)
Date: Mon, 16 Jan 2023 03:33:06 -0500 (EST)

branch: emacs-29
commit 3d1e74c82a84d9b2c5ad45a377512b5ee83b8d47
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    Fix tree-sitter indent preset function (bug#60270)
    
    * 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                                     |  1 -
 test/lisp/progmodes/c-ts-mode-resources/indent.erts | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/lisp/treesit.el b/lisp/treesit.el
index ffc78b9303..5e6f109531 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -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
diff --git a/test/lisp/progmodes/c-ts-mode-resources/indent.erts 
b/test/lisp/progmodes/c-ts-mode-resources/indent.erts
index 71524e273f..70fce68b0e 100644
--- a/test/lisp/progmodes/c-ts-mode-resources/indent.erts
+++ b/test/lisp/progmodes/c-ts-mode-resources/indent.erts
@@ -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 ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]