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.

Improve diff syntax highlighting queries (#21740)

uncenter9a806f98e66c
diff --git a/crates/languages/src/diff/highlights.scm b/crates/languages/src/diff/highlights.scm
index d8e600882c2..70ec01aa116 100644
--- a/crates/languages/src/diff/highlights.scm
+++ b/crates/languages/src/diff/highlights.scm
@@ -1,3 +1,5 @@
+(comment) @comment
+
[
(addition)
(new_file)
@@ -12,4 +14,35 @@
(location) @attribute
-(command) @function
+(command
+ "diff" @function
+ (argument) @variable.parameter)
+
+(filename) @string.special.path
+
+(mode) @number
+
+([
+ ".."
+ "+"
+ "++"
+ "+++"
+ "++++"
+ "-"
+ "--"
+ "---"
+ "----"
+] @punctuation.special)
+
+[
+ (binary_change)
+ (similarity)
+ (file_change)
+] @label
+
+(index
+ "index" @keyword)
+
+(similarity
+ (score) @number
+ "%" @number)