languages: Fix indentation for if/else statements in C/C++ without braces (#41670)

Closes #41179

Release Notes:

- Fixed indentation for if/else statements in C/C++ without braces
This commit is contained in:
Mayank Verma authored and GitHub committed 2025-11-17 10:05:54 +01:00
1 parent 3c6d58733b
commit 9ba97458e9
6 files changed
+477 -14

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ path_suffixes = ["cc", "hh", "cpp", "h", "hpp", "cxx", "hxx", "c++", "ipp", "inl
line_comments = ["// ", "/// ", "//! "]
decrease_indent_patterns = [
{ pattern = "^\\s*\\{.*\\}?\\s*$", valid_after = ["if", "for", "while", "do", "switch", "else"] },
{ pattern = "^\\s*else\\s*$", valid_after = ["if"] }
{ pattern = "^\\s*else\\b", valid_after = ["if"] }
]
autoclose_before = ";:.,=}])>"
brackets = [