Skip to content

Commit

Permalink
[Diff] Named context for header body
Browse files Browse the repository at this point in the history
Co-authored-by: deathaxe <[email protected]>
  • Loading branch information
michaelblyons and deathaxe committed Dec 15, 2024
1 parent afc7fc3 commit ab04f94
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions Diff/Diff.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,24 @@ contexts:
scope: meta.diff.header.from-file meta.header.from-file.diff
captures:
1: punctuation.definition.from-file.diff
push:
- match: '( (-) )(.* (={4})){{eol}}'
captures:
1: meta.header.diff
2: punctuation.separator.sequence.diff
3: meta.diff.header.to-file meta.header.to-file.diff
4: punctuation.definition.to-file.diff
pop: 1
- include: pop-immediately
push: header-body

# Still not sure what this is, but there's a preexisting unit test
- match: ^(={67}){{eol}}
scope: meta.separator.diff
captures:
1: punctuation.separator.block.diff

header-body:
- match: '( (-) )(.* (={4})){{eol}}'
captures:
1: meta.header.diff
2: punctuation.separator.sequence.diff
3: meta.diff.header.to-file meta.header.to-file.diff
4: punctuation.definition.to-file.diff
pop: 1
- include: pop-immediately

# https://www.gnu.org/software/diffutils/manual/diffutils.html#Detailed-Context
headers-context:
- match: ^(\*{15}){{eol}}
Expand Down

0 comments on commit ab04f94

Please sign in to comment.