-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changes: * the grammar has been completely rewritten in a way that removes some of the "jumpiness" of the highlights * when changing a command (for example from 'pick' to 'drop'), highlighting would treat parts of the commit hash as a command
- Loading branch information
1 parent
830585e
commit 443df23
Showing
3 changed files
with
37 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,36 @@ | ||
(operation operator: ["p" "pick" "r" "reword" "e" "edit" "s" "squash" "m" "merge" "d" "drop" "b" "break" "x" "exec"] @keyword) | ||
(operation operator: ["l" "label" "t" "reset"] @function) | ||
(operation operator: ["f" "fixup"] @function.special) | ||
; a rough translation: | ||
; * constant.builtin - git hash | ||
; * constant - a git label | ||
; * keyword - command that acts on commits commits | ||
; * function - command that acts only on labels | ||
; * comment - discarded commentary on a command, has no effect on the rebase | ||
; * string - text used in the rebase operation | ||
; * operator - a 'switch' (used in fixup and merge), either -c or -C at time of writing | ||
|
||
(((command) @keyword | ||
(label) @constant.builtin | ||
(message)? @comment) | ||
(#match? @keyword "^(p|pick|r|reword|e|edit|s|squash|d|drop)$")) | ||
|
||
(((command) @function | ||
(label) @constant | ||
(message)? @comment) | ||
(#match? @function "^(l|label|t|reset)$")) | ||
|
||
((command) @keyword | ||
(#match? @keyword "^(x|exec|b|break)$")) | ||
|
||
(((command) @function.special | ||
(label) @constant.builtin | ||
(message)? @comment) | ||
(#match? @function.special "^(f|fixup)$")) | ||
|
||
(((command) @keyword | ||
(label) @constant.builtin | ||
(label) @constant | ||
(message) @string) | ||
(#match? @keyword "^(m|merge)$")) | ||
|
||
(option) @operator | ||
(label) @string.special.symbol | ||
(commit) @constant | ||
"#" @punctuation.delimiter | ||
(comment) @comment | ||
|
||
(ERROR) @error | ||
(comment) @comment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
((operation | ||
operator: ["x" "exec"] | ||
(command) @injection.content) | ||
(((command) @__command__ | ||
(message) @injection.content) | ||
(#match? @__command__ "^(x|exec)$") | ||
(#set! injection.language "bash")) |