]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix c-ts-mode indentation (bug#75442)
authorYuan Fu <casouri@gmail.com>
Mon, 13 Jan 2025 06:23:36 +0000 (22:23 -0800)
committerEshel Yaron <me@eshelyaron.com>
Mon, 13 Jan 2025 12:12:04 +0000 (13:12 +0100)
* lisp/progmodes/c-ts-mode.el (c-ts-mode--simple-indent-rules):
Use standalone-parent instead of parent.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts:
New test.

(cherry picked from commit 04032cd00af7617c709140f3c80b5604b05c11e8)

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

index f4f6bef2775f5ecc36fbc6ffb98793e29d49852c..99e624412b2c52e367e7c9b9ec764c42199983e8 100644 (file)
@@ -474,7 +474,7 @@ MODE can be `c' or `cpp'.  STYLE can be `gnu', `k&r', `linux', `bsd'."
                                 "enum_specifier"
                                 "function_declarator"
                                 "template_declaration")))
-            parent 0)
+            standalone-parent 0)
            ;; This is for the trailing-star stype:  int *
            ;;                                       func()
            ((match "function_declarator" nil "declarator") parent-bol 0)
index 691f5b6ecfdc227283e8c613f8b4759b8e425602..3d875e3113ee60b2c97a09565d2ff0a30517cdff 100644 (file)
@@ -149,6 +149,16 @@ fn()
 };
 =-=-=
 
+Name: typedef with struct definition (bug#75442)
+
+=-=
+typedef struct Point
+{
+  int x;
+  int y;
+} Point;
+=-=-=
+
 Name: Multiline Parameter List (bug#60398)
 
 =-=