-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Diff] Organize contexts, add tests, support Git patch emails #4111
base: master
Are you sure you want to change the base?
Conversation
Also include their file modes [Diff] Change file mode highlighting [Diff] Loosen file mode match
Includes the Git Commit Message stuff, because that's what it is.
[Diff] Empty file hash
Technically, this is called the "signature."
1. introduce named contexts for content blocks 2. re-include `diff3-edit` 3. add some tests
This commit... 1. scopes `,` in ranges `punctuation.separator.range` as numbers before and after denote beginning and end of modified content range, but no sequence of arbitrary numbers. 2. scopes diff3 hunks `meta.hunk` 3. scope whole diff3 change markers `meta.range` to achieve same segmentation as for `@@ ... @@` range markers in unified diffs. 4. add diff3 modifications to toc-list Scope change markers `meta.toc-list`. Exclude eol to correctly separate them in symbol list.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I've brought Conflict.sublime-syntax back in, along with a conservative side-by-side highlighter. A more risky side-by-side syntax at michaelblyons#10 |
31a90d5
to
39a126a
Compare
This comment was marked as resolved.
This comment was marked as resolved.
let us know when/if you need any review or feedback 😁 |
Haha. Sorry if you're flooded in notifications. The PR is a lot better after you and DeathAxe's reviews. I think if you're looking for something, check my PRs to this PR (michaelblyons#11 and michaelblyons#10) and decide if you care about any of the things in the "controversial" heading in OP. Thanks again. |
Maybe you could add an empty line between meta patterns (https://www.sublimetext.com/docs/syntax.html#meta-patterns) and the rest in your named contexts. Compare: contexts:
name:
- meta_include_prototype: false
- meta_scope: one
- meta_content_scope: two
- include: three
- include: four vs. contexts:
name:
- meta_include_prototype: false
- meta_scope: one
- meta_content_scope: two
- include: three
- include: four Makes it easier to read. |
On a related note, when applying multiple scopes: Compare: contexts:
name:
- meta_include_prototype: false
- meta_scope: one two three
- meta_content_scope: four
- include: five
- include: six vs. contexts:
name:
- meta_include_prototype: false
- meta_scope: >-
one
two
three
- meta_content_scope: four
- include: five
- include: six Makes it easier to read and makes for easier to understand diffs in the git history of this repo. |
Empty lines between contexts is ok, but starting arbritary emptly lines between patterns is too much. |
There are places where I have considered newlines in stacked scopes, but I am not planning to add an empty line between meta and includes. PackageDev scoping is sufficient to make that distinction very obvious. |
This started out as an attempt to use parts of an email syntax I wrote to support front matter in Git patch emails. It kind of ballooned after that to include a big refactor of the base Diff syntax according to the GNU
patch
spec.I would not claim this is perfect, but I'd like some other eyes on it. Edit: Much improved. Thanks to the reviewers!
Notable changes
git am
andgit format-patch
)Potentially controversial
I made a "conflict" syntax separate from the diff syntax, but if other people have strong feelings about conflict markers being part of Diff.sublime-syntax, I'd consider trying to bring it in.Edit: I pulled it back into main Diffstorage.modifier
to distinguish between the two Git file modes (namely644
and755
)++++----
and similar, even though they're not actually markup.Requested changes
contexts