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 syntax highlighting of git commit messages (#26988)

Cole Miller22b8662275e1
diff --git a/crates/languages/src/gitcommit/config.toml b/crates/languages/src/gitcommit/config.toml
index c8ffca31056..ae4b836ed66 100644
--- a/crates/languages/src/gitcommit/config.toml
+++ b/crates/languages/src/gitcommit/config.toml
@@ -1,5 +1,5 @@
name = "Git Commit"
-grammar = "git_commit"
+grammar = "gitcommit"
path_suffixes = [
"TAG_EDITMSG",
"MERGE_MSG",
diff --git a/crates/languages/src/gitcommit/highlights.scm b/crates/languages/src/gitcommit/highlights.scm
index 319d76569e5..8670a6615aa 100644
--- a/crates/languages/src/gitcommit/highlights.scm
+++ b/crates/languages/src/gitcommit/highlights.scm
@@ -4,6 +4,7 @@
(commit) @constant
(item) @markup.link.url
(header) @tag
+(comment) @comment
(change kind: "new file" @diff.plus)
(change kind: "deleted" @diff.minus)
@@ -15,4 +16,3 @@
value: (trailer_value) @string)
[":" "=" "->" (scissors)] @punctuation.delimiter
-(comment) @comment
diff --git a/crates/languages/src/lib.rs b/crates/languages/src/lib.rs
index 5504650fc03..29afa3f0a97 100644
--- a/crates/languages/src/lib.rs
+++ b/crates/languages/src/lib.rs
@@ -202,6 +202,10 @@ pub fn init(languages: Arc<LanguageRegistry>, node: NodeRuntime, cx: &mut App) {
adapters: vec![yaml_lsp_adapter],
..Default::default()
},
+ LanguageInfo {
+ name: "gitcommit",
+ ..Default::default()
+ },
];
for registration in built_in_languages {
diff --git a/crates/panel/src/panel.rs b/crates/panel/src/panel.rs
index b1c55777c7e..9859bf6444f 100644
--- a/crates/panel/src/panel.rs
+++ b/crates/panel/src/panel.rs
@@ -113,6 +113,7 @@ pub fn panel_editor_style(monospace: bool, window: &Window, cx: &App) -> EditorS
line_height: line_height.into(),
..Default::default()
},
+ syntax: cx.theme().syntax().clone(),
..Default::default()
}
}