-
Notifications
You must be signed in to change notification settings - Fork 103
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
Fix ic textobject mapping and document it #258
base: master
Are you sure you want to change the base?
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).
@@ -274,8 +274,8 @@ if g:tcomment_maps | |||
exec 'xmap '. g:tcomment_mapleader_comment_anyway .' <Plug>TComment_Comment' | |||
endif | |||
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' |
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.
There is no need for the extra period here.
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.
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).
Thanks. |
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! |
Currently the mapping for the
ic
(inline comment) mapping has no spacein between the
omap
andg:tcomment_textobject_inlinecomment
partsmeaning 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).