From 1c1641fa32ceeaa24af5b7e27bbb815fbd14f582 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Sun, 12 Jan 2025 22:23:36 -0800 Subject: [PATCH] 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. (cherry picked from commit 04032cd00af7617c709140f3c80b5604b05c11e8) --- 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) =-= -- 2.39.5