diff options
| author | Yuan Fu | 2025-01-12 22:23:36 -0800 |
|---|---|---|
| committer | Yuan Fu | 2025-01-12 22:23:36 -0800 |
| commit | 04032cd00af7617c709140f3c80b5604b05c11e8 (patch) | |
| tree | 6cab4453a092ead7827488481f76085b81df8dce | |
| parent | 7d3bc1ff2f44215ad24fdd8b243e7cee8ff66fa0 (diff) | |
| download | emacs-04032cd00af7617c709140f3c80b5604b05c11e8.tar.gz emacs-04032cd00af7617c709140f3c80b5604b05c11e8.zip | |
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.
| -rw-r--r-- | lisp/progmodes/c-ts-mode.el | 2 | ||||
| -rw-r--r-- | test/lisp/progmodes/c-ts-mode-resources/indent.erts | 10 |
2 files changed, 11 insertions, 1 deletions
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'." | |||
| 474 | "enum_specifier" | 474 | "enum_specifier" |
| 475 | "function_declarator" | 475 | "function_declarator" |
| 476 | "template_declaration"))) | 476 | "template_declaration"))) |
| 477 | parent 0) | 477 | standalone-parent 0) |
| 478 | ;; This is for the trailing-star stype: int * | 478 | ;; This is for the trailing-star stype: int * |
| 479 | ;; func() | 479 | ;; func() |
| 480 | ((match "function_declarator" nil "declarator") parent-bol 0) | 480 | ((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() | |||
| 149 | }; | 149 | }; |
| 150 | =-=-= | 150 | =-=-= |
| 151 | 151 | ||
| 152 | Name: typedef with struct definition (bug#75442) | ||
| 153 | |||
| 154 | =-= | ||
| 155 | typedef struct Point | ||
| 156 | { | ||
| 157 | int x; | ||
| 158 | int y; | ||
| 159 | } Point; | ||
| 160 | =-=-= | ||
| 161 | |||
| 152 | Name: Multiline Parameter List (bug#60398) | 162 | Name: Multiline Parameter List (bug#60398) |
| 153 | 163 | ||
| 154 | =-= | 164 | =-= |