From b2150a4f02555350e03fd975b4d23fb8fd5761c2 Mon Sep 17 00:00:00 2001 From: feeiyu <158308373+feeiyu@users.noreply.github.com> Date: Tue, 10 Feb 2026 08:02:23 +0800 Subject: [PATCH] Fix incorrect first line detection for libstdc++ files (#48351) https://github.com/zed-industries/zed/pull/48250#issuecomment-3846774856 To ensure the fix covers all affected files, I have checked all C++ files without extensions using the following command: ```bash find /usr/include/c++ -type f | grep -v '.h' | grep -v '.cpp' | grep -v '.tcc' | xargs head -1 | zed - ```
Click to expand images image image image image
Release Notes: - N/A --- crates/languages/src/cpp/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/languages/src/cpp/config.toml b/crates/languages/src/cpp/config.toml index b10802ed9310d620ad7d36da2087430f4bead24c..10c36a6ded1e1f3a1204d1e15af47fee78b8e049 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"] }