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

toggle emphasis moves punctuation after word when used with visual selection #188

Open
hbpasti opened this issue Sep 28, 2016 · 2 comments
Labels

Comments

@hbpasti
Copy link

hbpasti commented Sep 28, 2016

Using the "toggle emphasis" shortcut moves punctuation after a word when applied to a selection made with 'inner word' motion (viw, <localleader>i).

This is a word.

ends up:

This is a .*word*

Using the regular command+motion instead of visual+motion+command results
in the punctuation being emphasized also:

This is a *word.*

which is not desirable.

(Perhaps there could be different behaviors for <localleader>i<n>w and <localleader>i<n>W to mimic the difference between "word" and "WORD" motions?)

@fmoralesc fmoralesc added the bug label May 5, 2019
@dubiousjim
Copy link

Came to make bug report about this and found this old issue. Clarification: the issue only happens for punctuation at the end of a line. Thus if you had:

This is a word, and this is another.

Then doing viw inside word, then <localleader>i would work fine. But if you did it inside another, the period would be moved before the emphasized text.

For me, this chafes the most when doing pandoc-keyboard-toggle-verbatim.

@dubiousjim
Copy link

dubiousjim commented Feb 16, 2022

This is still an issue as of 2f57074.

Looks like 2f7a82e from 2016 fixes a nearby issue (but not the same).

dubiousjim added a commit to dubiousjim/vim-pandoc that referenced this issue Feb 16, 2022
Seems to work locally. But I don't know vimscript, so definitely should be reviewed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants