Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix incorrect first line detection for libstdc++ files (#48351)

feeiyub2150a4f0255
diff --git a/crates/languages/src/cpp/config.toml b/crates/languages/src/cpp/config.toml
index b10802ed931..10c36a6ded1 100644
--- a/crates/languages/src/cpp/config.toml
+++ b/crates/languages/src/cpp/config.toml
@@ -2,7 +2,7 @@ name = "C++"
grammar = "cpp"
path_suffixes = ["cc", "hh", "cpp", "h", "hpp", "cxx", "hxx", "c++", "h++", "ipp", "inl", "ino", "ixx", "cu", "cuh", "C", "H"]
line_comments = ["// ", "/// ", "//! "]
-first_line_pattern = '\/\/\s*(<.*>\s)?-\*-\s*C\+\+\s*-\*-'
+first_line_pattern = '^//.*-\*-\s*C\+\+\s*-\*-'
decrease_indent_patterns = [
{ pattern = "^\\s*\\{.*\\}?\\s*$", valid_after = ["if", "for", "while", "do", "switch", "else"] },
{ pattern = "^\\s*else\\b", valid_after = ["if"] }