Fix ic textobject mapping and document it#258
Open
atomictom wants to merge 2 commits intotomtom:masterfrom
Open
Fix ic textobject mapping and document it#258atomictom wants to merge 2 commits intotomtom:masterfrom
atomictom wants to merge 2 commits intotomtom:masterfrom
Conversation
Currently the mapping for the `ic` (inline comment) mapping has no space in between the `omap` and `g:tcomment_textobject_inlinecomment` parts meaning that the whole expression would look like: `exec 'omapic <Plug>TComment_ic'` rather than `exec 'omap ic <Plug>TComment_ic'`.
This addresses tomtom#255 and tomtom#188. It also partially addresses tomtom#237 (by making it clear that the functionality exists, even if it doesn't quite do what's being asked for there).
tomtom
reviewed
Jan 5, 2020
| if g:tcomment_textobject_inlinecomment != '' | ||
| exec 'vmap' g:tcomment_textobject_inlinecomment ' <Plug>TComment_ic' | ||
| exec 'omap' g:tcomment_textobject_inlinecomment ' <Plug>TComment_ic' | ||
| exec 'vmap '. g:tcomment_textobject_inlinecomment .' <Plug>TComment_ic' |
Owner
There was a problem hiding this comment.
There is no need for the extra period here.
Author
There was a problem hiding this comment.
I did that to be consistent with the code a few lines above (all the other mappings use dots for string concat). But, I can remove it if you prefer (just let me know).
Owner
Thanks. |
Author
No rush! It's the added space that should fix the issue. The periods are just to be consistent in style with the code above it (which also use them).
As far as I can tell, this is only true for the commands and maybe some of the functions, but I can't see where this is done for individual options. But, maybe I'm missing something so let me know if I am and I can fix it up! |
This file contains hidden or 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
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.
Currently the mapping for the
ic(inline comment) mapping has no spacein between the
omapandg:tcomment_textobject_inlinecommentpartsmeaning that the whole expression would look like:
exec 'omapic <Plug>TComment_ic'rather thanexec 'omap ic <Plug>TComment_ic'.I also mentioned this in #255 (comment) and partially addresses #237.
I've also added some brief docs that acknowledge the existence of this functionality as well as how to change or disable the mapping.
This also addresses #255 and #188. It also partially addresses #237 (by making
it clear that the functionality exists, even if it doesn't quite do what's being asked for there).