[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 04032cd00af: Fix c-ts-mode indentation (bug#75442)
From: |
Yuan Fu |
Subject: |
master 04032cd00af: Fix c-ts-mode indentation (bug#75442) |
Date: |
Mon, 13 Jan 2025 01:24:23 -0500 (EST) |
branch: master
commit 04032cd00af7617c709140f3c80b5604b05c11e8
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>
Fix c-ts-mode indentation (bug#75442)
* 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.
---
lisp/progmodes/c-ts-mode.el | 2 +-
test/lisp/progmodes/c-ts-mode-resources/indent.erts | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index f4f6bef2775..99e624412b2 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -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)
diff --git a/test/lisp/progmodes/c-ts-mode-resources/indent.erts
b/test/lisp/progmodes/c-ts-mode-resources/indent.erts
index 691f5b6ecfd..3d875e3113e 100644
--- a/test/lisp/progmodes/c-ts-mode-resources/indent.erts
+++ b/test/lisp/progmodes/c-ts-mode-resources/indent.erts
@@ -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)
=-=
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 04032cd00af: Fix c-ts-mode indentation (bug#75442),
Yuan Fu <=