mirror of
https://github.com/helix-editor/helix.git
synced 2025-04-06 12:27:42 +03:00
Add tree-sitter-git-diff (#1373)
* add submodule on tree-sitter-git-diff * add git-diff highlights * inject git-diff into git-commit * update tree-sitter-git-commit with fix for bad diff case * add git-diff to language support docs * include-children in diff injections This ensures that children nodes of $.message are included in the injection, such as $.user or issue/pr numbers. Without this change, diffs containing '#' or '@' characters can trip up the injection and be parsed separately. See https://github.com/helix-editor/helix/pull/1373#issuecomment-1001215629 * set diff language's scope as source.diff
This commit is contained in:
parent
49444f9c05
commit
bcf3808e97
8 changed files with 26 additions and 14 deletions
|
@ -1,12 +1,7 @@
|
|||
; once a diff grammar is available, we can inject diff highlighting into the
|
||||
; trailer after scissors (git commit --verbose)
|
||||
; see https://github.com/helix-editor/helix/pull/1338#issuecomment-1000013539
|
||||
;
|
||||
; ((comment (scissors))
|
||||
; (message) @injection.content
|
||||
; (#set! injection.language "diff"))
|
||||
|
||||
; ---
|
||||
((comment (scissors))
|
||||
(message) @injection.content
|
||||
(#set! injection.include-children)
|
||||
(#set! injection.language "diff"))
|
||||
|
||||
; once a rebase grammar is available, we can inject rebase highlighting into
|
||||
; interactive rebase summary sections like so:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue