Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

atomictom
Copy link

@atomictom atomictom commented Dec 30, 2019

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'.

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).

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).
@atomictom atomictom changed the title Fix string concatenation for ic textobject mapping Fix ic textobject mapping and document it Dec 30, 2019
@@ -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'
Copy link
Owner

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.

Copy link
Author

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).

@tomtom
Copy link
Owner

tomtom commented Jan 5, 2020

  1. I cannot currently look into this. I'd be surprised if the period solved a problem -- please see :help :exec.
  2. The docs are generated from comments in the source. Please add the docs there.

Thanks.

@atomictom
Copy link
Author

  1. I cannot currently look into this. I'd be surprised if the period solved a problem -- please see :help :exec.

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).

  1. The docs are generated from comments in the source. Please add the docs there.

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!

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.

None yet

2 participants