diff --git a/languages.toml b/languages.toml index 63b538420..a2dc2053d 100644 --- a/languages.toml +++ b/languages.toml @@ -1859,13 +1859,14 @@ name = "git-commit" scope = "git.commitmsg" file-types = [{ glob = "COMMIT_EDITMSG" }, { glob = "MERGE_MSG" }] comment-token = "#" -indent = { tab-width = 2, unit = " " } +indent = { tab-width = 4, unit = " " } rulers = [51, 73] text-width = 72 +grammar = "gitcommit" [[grammar]] -name = "git-commit" -source = { git = "https://github.com/the-mikedavis/tree-sitter-git-commit", rev = "6f193a66e9aa872760823dff020960c6cedc37b3" } +name = "gitcommit" +source = { git = "https://github.com/gbprod/tree-sitter-gitcommit", rev = "a716678c0f00645fed1e6f1d0eb221481dbd6f6d" } [[language]] name = "diff" diff --git a/runtime/queries/git-commit/highlights.scm b/runtime/queries/git-commit/highlights.scm index 319d76569..bc84d0371 100644 --- a/runtime/queries/git-commit/highlights.scm +++ b/runtime/queries/git-commit/highlights.scm @@ -1,18 +1,18 @@ +[(comment) (generated_comment) (scissor)] @comment (subject) @markup.heading -(path) @string.special.path (branch) @string.special.symbol -(commit) @constant -(item) @markup.link.url -(header) @tag +(filepath) @string.special.path +(arrow) @punctuation.delimiter +(subject (subject_prefix) @function) +(prefix (type) @keyword) +(prefix (scope) @variable.parameter) +(prefix [ "(" ")" ":" ] @punctuation.delimiter) +(prefix "!" @punctuation.special) +(trailer (token) @variable.other.member) +(trailer (value) @string) +(breaking_change (token) @special) -(change kind: "new file" @diff.plus) -(change kind: "deleted" @diff.minus) -(change kind: "modified" @diff.delta) -(change kind: "renamed" @diff.delta.moved) - -(trailer - key: (trailer_key) @variable.other.member - value: (trailer_value) @string) - -[":" "=" "->" (scissors)] @punctuation.delimiter -(comment) @comment +(change kind: (new)) @diff.plus +(change kind: (deleted)) @diff.minus +(change kind: (modified)) @diff.delta +(change kind: [(renamed) (typechange)]) @diff.delta.moved diff --git a/runtime/queries/git-commit/injections.scm b/runtime/queries/git-commit/injections.scm index 79f7691a9..823188e01 100644 --- a/runtime/queries/git-commit/injections.scm +++ b/runtime/queries/git-commit/injections.scm @@ -1,6 +1,4 @@ -(((scissors) - (message) @injection.content) - (#set! injection.include-children) +((diff) @injection.content (#set! injection.language "diff")) ((rebase_command) @injection.content