X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=runtime%2Fsyntax%2Fgit-commit.yaml;h=d8c164792163fd2fd96580b18cee17224461c837;hb=24a684cff25cd9f189a943d1dc2a98d3aa6c796f;hp=222856c17ae67fd4f352023127c9359752c9231a;hpb=ba4b02807627820d741e7e68b75a0818926e9fe6;p=micro.git diff --git a/runtime/syntax/git-commit.yaml b/runtime/syntax/git-commit.yaml index 222856c1..d8c16479 100644 --- a/runtime/syntax/git-commit.yaml +++ b/runtime/syntax/git-commit.yaml @@ -1,29 +1,36 @@ filetype: git-commit detect: - filename: "COMMIT_EDITMSG|TAG_EDITMSG" + filename: "^(.*[\\/])?(COMMIT_EDITMSG|TAG_EDITMSG)$" rules: - # Commit message - - ignore: ".*" - # Comments - - comment: - start: "^#" - end: "$" - rules: [] # File changes - type.keyword: "#[[:space:]](deleted|modified|new file|renamed):[[:space:]].*" - type.keyword: "#[[:space:]]deleted:" - type.keyword: "#[[:space:]]modified:" - type.keyword: "#[[:space:]]new file:" - type.keyword: "#[[:space:]]renamed:" - # Untracked filenames - - error: "^# [^/?*:;{}\\\\]+\\.[^/?*:;{}\\\\]+$" - type.keyword: "^#[[:space:]]Changes.*[:]" - type.keyword: "^#[[:space:]]Your branch and '[^']+" - type.keyword: "^#[[:space:]]Your branch and '" - type.keyword: "^#[[:space:]]On branch [^ ]+" - type.keyword: "^#[[:space:]]On branch" - # Recolor hash symbols - - special: "#" + # Color keywords for closing issues (such as on Github) + - type.keyword: "\\b(?i)((fix(es|ed)?|close(s|d)?) #[0-9]+)\\b" + + # Comments + - comment.line: + start: "^#" + end: "$" + rules: [] + # Diffs (i.e. git commit --verbose) + - default: + start: "^diff" + # Diff output puts a space before file contents on each line so this + # should never match valid diff output and extend highlighting to the + # end of the file + end: "^ENDOFFILE" + limit-group: "magenta" + rules: + - include: "patch"