Skip to content

Highlight below the fold as a comment #1680

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

Merged
merged 3 commits into from
Sep 22, 2020
Merged

Conversation

osfameron
Copy link
Contributor

Add a uBelowFold syntax region, highlighted as a comment.

Overview

As Unison itself ignores everything below the fold, it makes sense to format the contents as a comment, rather than Unison highlighted.

Implementation notes

This uses the Syntax Region highlighting feature in Vim.
I'm not 100% how the skip and end features work, but I copied it from perl.vim as Perl has an analogous __END__ marker construct.

Interesting/controversial decisions

Don't think so.

Test coverage

None provided, I don't know how to test Vim syntax files.

Loose ends

Could potentially add folding support?

Add a `uBelowFold` syntax region, highlighted as a comment.
Unison uses a comment like this to signal the fold after an `edit`

    ---- Anything below this line is ignored by Unison.

The previous definition of `uBelowFold` was a line starting with
"---- ". But in fact a fold is triggered by 3 or more dashes at the
start of a line, and doesn't require a space.
@pchiusano
Copy link
Member

@osfameron cool! would you mind adding yourself to CONTRIBUTORS.markdown as part of this PR?

@osfameron
Copy link
Contributor Author

OK, updated Contributors.markdown above!

@pchiusano pchiusano added the ready-to-merge Apply this to a PR and it will get merged automatically once CI passes and 1 reviewer has approved label Sep 22, 2020
Copy link
Member

@pchiusano pchiusano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mergify mergify bot merged commit 656d941 into unisonweb:trunk Sep 22, 2020
@mergify mergify bot removed the ready-to-merge Apply this to a PR and it will get merged automatically once CI passes and 1 reviewer has approved label Sep 22, 2020
@pchiusano pchiusano mentioned this pull request May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants