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

Incorrect behaviour with :normal . command #2

Closed
nashbridges opened this issue Nov 23, 2012 · 5 comments
Closed

Incorrect behaviour with :normal . command #2

nashbridges opened this issue Nov 23, 2012 · 5 comments

Comments

@nashbridges
Copy link

I'm not sure whether it's vim-textobject-line or vim-surround issue. Suppose I have this text:

hello world
bye world
hello again!

Then I run vim-surround command on the first line ysal"

"hello world"
bye world
hello again!

Then I select two remaining lines with Vj and try to run :normal .

"hello world"
"bye world"
"hello aga"in!

If I start from the last (longest) line, I get correct result. If I select all lines and run :normal ysal", the result is also correct.

@kana
Copy link
Owner

kana commented Nov 28, 2012

Thank you for the feedback. The problem happens also by directly typing . in Normal mode, doesn't it?

@kana
Copy link
Owner

kana commented Nov 28, 2012

Anyway, it would be better to use yss" instead of ysal". The former is properly repeatable.

@nashbridges
Copy link
Author

You're right, ysal" is not correctly repeatable in any mode. yss" works just fine, thanks for reply!

@kana
Copy link
Owner

kana commented Nov 28, 2012

I investigated the problem. In short, it might be possible to fix the problem. But it's a hard work. I'll try to investigate more deeply when I have spare time.

Technically, Vim has a buffer to record the last executed command for .. The buffer contains the key sequence to execute the last executed command. For example, if you type ysal", Vim maps ys and al to magic stuffs defined by vim-surround and vim-textobj-line. So that Vim doesn't record ysal" as is. Vim records an expanded result of ysal" instead.
Usually . repeats a command according to the buffer. But Vim doesn't record expanded key sequence as is in some cases. That's why al is not correctly repeatable.

@kana
Copy link
Owner

kana commented Jul 9, 2013

Please upgrade Vim to 7.3.918 or later. This issue has been resolved by Vim 7.3.918.

@kana kana closed this as completed Jul 9, 2013
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

No branches or pull requests

2 participants