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
Syntect comment toggle #991
Merged
Merged
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
cmyr
added a commit
to cmyr/xi-mac
that referenced
this pull request
Nov 13, 2018
cmyr
added a commit
to cmyr/xi-mac
that referenced
this pull request
Nov 13, 2018
This was referenced Nov 13, 2018
cmyr
force-pushed
the
feature/syntect-comment-toggle
branch
2 times, most recently
from
November 19, 2018 19:20
14de5dd
to
67fcc78
Compare
cmyr
added a commit
to cmyr/xi-mac
that referenced
this pull request
Nov 20, 2018
This was referenced Nov 21, 2018
Closed
This adds syntax-aware comment toggling. The implementation is sort of weird, in a way that maybe highlights some of the general weirdness around this feature, and also maybe illustrates some future directions for plugin- provided commands. Basically: comment toggling, like auto-indent, is syntax dependant. Unlike auto-indent, however, it is also the result of an explicit user action. This is a funny case. It seems silly to add a 'toggle_comment' command to the RPC protocol. We do need to route through core, because we need to extract the lines to be commented; plugins do not currently have access to selection state. However we only expect this to be handled by one plugin. So: this is a hack. This has given me some ideas about how plugins can declare their capabilities, though; I'll open an issue for that in a little bit. In the meantime, this is a useful feature.
cmyr
force-pushed
the
feature/syntect-comment-toggle
branch
from
November 27, 2018 04:09
67fcc78
to
6caed8a
Compare
raphlinus
approved these changes
Nov 29, 2018
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.
This looks good to me, and is very useful functionality. Thanks!
cmyr
added a commit
to cmyr/xi-mac
that referenced
this pull request
Nov 29, 2018
cmyr
added a commit
to xi-editor/xi-mac
that referenced
this pull request
Nov 30, 2018
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.
This is based off of #971; the meat here is just the last commit.
There are some things about this implementation that are... weird. It isn't totally clear that this should be in syntect and not in core.
closes #795
This adds syntax-aware comment toggling.
The implementation is sort of weird, in a way that maybe
highlights some of the general weirdness around this feature,
and also maybe illustrates some future directions for plugin-
provided commands.
Basically: comment toggling, like auto-indent, is syntax
dependant. Unlike auto-indent, however, it is also the result
of an explicit user action.
This is a funny case. It seems silly to add a 'toggle_comment'
command to the RPC protocol. We do need to route through core,
because we need to extract the lines to be commented; plugins
do not currently have access to selection state. However we only
expect this to be handled by one plugin.
So: this is a hack. This has given me some ideas about how
plugins can declare their capabilities, though; I'll open an
issue for that in a little bit.
In the meantime, this is a useful feature.