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.

Highlight bash conditionals and arithmetic operators (#56484)

liam5e36ec82562b
diff --git a/crates/grammars/src/bash/highlights.scm b/crates/grammars/src/bash/highlights.scm
index bc1c3b7ec11..c67b34e92c9 100644
--- a/crates/grammars/src/bash/highlights.scm
+++ b/crates/grammars/src/bash/highlights.scm
@@ -72,6 +72,7 @@
[
"$"
"&&"
+ "||"
">"
"<<"
">>"
@@ -86,8 +87,36 @@
"%%"
"#"
"##"
+ "+="
+ "-="
+ "*="
+ "/="
+ "%="
+ "**="
+ "<<="
+ ">>="
+ "&="
+ "^="
+ "|="
"="
+ "=~"
"=="
+ "!="
+ "-o"
+ "-a"
+ "^"
+ "&"
+ "<="
+ ">="
+ "+"
+ "-"
+ "*"
+ "**"
+ "!"
+ "++"
+ "--"
+ "~"
+ "?"
] @operator
(test_operator) @keyword.operator
@@ -103,6 +132,18 @@
"]"
] @punctuation.bracket
+(test_command
+ [
+ "[["
+ "]]"
+ ] @punctuation.bracket)
+
+(compound_statement
+ [
+ "(("
+ "))"
+ ] @punctuation.bracket)
+
(simple_expansion
"$" @punctuation.special)
@@ -114,6 +155,14 @@
"$(" @punctuation.special
")" @punctuation.special)
+(arithmetic_expansion
+ [
+ "$(("
+ "$["
+ "))"
+ "]"
+ ] @punctuation.special)
+
((command
(_) @constant)
(#match? @constant "^-"))