diff --git a/queries/fish/highlights.scm b/queries/fish/highlights.scm index 10d54dff7..838251201 100644 --- a/queries/fish/highlights.scm +++ b/queries/fish/highlights.scm @@ -7,15 +7,21 @@ "||" "|" "&" - "=" - "!=" ".." "!" (direction) (stream_redirect) - (test_option) ] @operator +; match operators of test command +(command + name: (word) @function (#match? @function "^test$") + argument: (word) @operator (#match? @operator "^(!?\\=|-[a-zA-Z]+)$")) + +;; match operators of [ command +(test_command + argument: (word) @operator (#match? @operator "^(!?\\=|-[a-zA-Z]+)$")) + [ "not" "and" @@ -103,7 +109,7 @@ ] ) -(command_substitution_dollar "$" @punctuation.bracket) +(command_substitution "$" @punctuation.bracket) ; non-bultin command names (command name: (word) @function.call) @@ -116,7 +122,7 @@ ] ) -(test_command "test" @function.builtin) +(test_command (word) @function.builtin) ;; Functions @@ -150,7 +156,6 @@ [(integer) (float)] @number (comment) @comment (comment) @spell -(test_option) @string ((word) @boolean (#any-of? @boolean "true" "false"))