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
2025-11-17 10:05:54 +01:00
committed by GitHub
parent b463266fa1
commit d32934a893
6 changed files with 477 additions and 14 deletions
+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 = [