-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
feat: allow TS users to highlight marker delimiters #623
Merged
kristijanhusak
merged 3 commits into
nvim-orgmode:master
from
PriceHiller:feat/ts-delimiter-highlights
Nov 2, 2023
Merged
feat: allow TS users to highlight marker delimiters #623
kristijanhusak
merged 3 commits into
nvim-orgmode:master
from
PriceHiller:feat/ts-delimiter-highlights
Nov 2, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PriceHiller
force-pushed
the
feat/ts-delimiter-highlights
branch
2 times, most recently
from
October 31, 2023 20:53
d164905
to
772c7d6
Compare
This permits those of us who use treesitter to change the highlights surrounding markers. E.g. for the "verbatim" marker we can now highlight the "=" characters individually instead of the entire chunk being the same highlight. This is particularly useful in tables with lots of code elements, this makes it easier to tell the delimiter characters apart from the primary marker.
PriceHiller
force-pushed
the
feat/ts-delimiter-highlights
branch
from
October 31, 2023 20:55
772c7d6
to
b8c4ece
Compare
kristijanhusak
requested changes
Nov 2, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Generally looks good, but it needs some minor cleanup.
See nvim-orgmode#623 (comment) > I don't think we need this. `syn` is used for old Vim syntax highlighting.
PriceHiller
added a commit
to PriceHiller/orgmode
that referenced
this pull request
Nov 2, 2023
See nvim-orgmode#623 (comment) > We don't need delimiters highlight for `latex` type since we do not handle those markers as markup and we do not add extmarks for them.
PriceHiller
added a commit
to PriceHiller/orgmode
that referenced
this pull request
Nov 2, 2023
See nvim-orgmode#623 (comment) > We don't need delimiters highlight for `latex` type since we do not handle those markers as markup and we do not add extmarks for them.
PriceHiller
force-pushed
the
feat/ts-delimiter-highlights
branch
from
November 2, 2023 16:25
1bebec3
to
c286e87
Compare
See nvim-orgmode#623 (comment) > We don't need delimiters highlight for `latex` type since we do not handle those markers as markup and we do not add extmarks for them.
PriceHiller
force-pushed
the
feat/ts-delimiter-highlights
branch
from
November 2, 2023 16:30
c286e87
to
056107d
Compare
kristijanhusak
approved these changes
Nov 2, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
SlayerOfTheBad
pushed a commit
to SlayerOfTheBad/orgmode
that referenced
this pull request
Aug 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! This PR permits (as per the current commit) a user of orgmode to set the highlights for the delimiters around
markers.
Take for instance something like:
Prior to this PR those of us who used Treesitter with Nvim-Orgmode were unable to specify a specific highlight for the
equals sign,
=
. I have added a simple syntax match for those markers and bound them according to their main markergroup name. For instance, the
org_code
group also hasorg_code_delimiter
now relating to its beginning and endingdelimiters.
I'm taking advantage of the
extmarks
that were set to highlight the entire block by using offsets. If you know of abetter way, feel free share! I'm willing to implement a better implementation if I can get a pointer; otherwise this
gets the job done.
Before (unable to change the highlights for the
~
delimiters):After: