Comment #13 on issue 115 by [email protected]: Vim Macro to generate ASCII characters
http://code.google.com/p/vim/issues/detail?id=115

I finally reproduced the issue, using the keypad like you discovered; so although you still didn't explain, it's probably not important at this point what you didn't see.

I certainly would not expect this behavior, but I actually think I know the cause. I suspect it's because Vim actually distinguishes between 1 and <k1>, 2 and <k2>, etc. keys to allow mapping them differently. So the macro contains special escape sequences for the keypad keys which aren't present when using normal numerics.

To demonstrate the difference, try the following:

qao<k1><k2><k3><Esc>q
qbo123<Esc>q

Both these macros do the same thing when executed. Both will make a new line with text, 123. But now examine the register contents:

:reg a
:reg b

For me at least, on Windows gvim, they are drastically different!

Not all systems actually send Vim a different sequence for the keypad keys; on these systems, 1 and <k1> are not separately mappable.

I think this will only pop up when somebody tries using a recorded macro both as a recording and as text for insertion and manipulation. I'm not sure whether it's possible to fix without breaking the separate mapping capability of the keypad, or even if there is something to fix at all.

A person who wrote the macro in the first place would know what they were trying to accomplish at each step in the macro. When they pasted the contents of the unnamed register, hoping to get a numeric value which could then be incremented, if they saw the special escape sequences, they would immediately know something was wrong. I don't actually think there is anything to fix here, unless it's just seen as another place Vim's internal representation of special keys causes weird behavior.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui