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
allow KEYMAP with @a #543
base: master
Are you sure you want to change the base?
allow KEYMAP with @a #543
Conversation
…id AttributeError (if_py_both.h)
Roland Puntaier wrote:
The 'keymap' option is meant for when typing text in Insert mode. It A register contains commands, which may start Insert mode and then I wonder how you managed to get characters into a register that you want
Yes, there are undesired side effects. ARTHUR: Shut up! Will you shut up! /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \ |
On Wed, Dec 30, 2015 at 9:10 PM, Bram Moolenaar
To insert text, I would use "a (or, in Insert mode, ^Ra), not @A. But I'm not very familiar with the 'langmap' option but I would expect
|
Dear Bram,
Not ALL characters are translated, because the map hash includes the vim State:
The hash is generated with LANG_MAP:
For vim.h:
This means keymap only applies to INSERT and CMDLINE, as it should be. Note: With LANGMAP I meant and mean the define in the C code not :set langmap. Note: Probably russians will have a russian keyboard layout and use :set
Please name the undesired side effects, else I can't decide, whether you think, there are, |
On 12/30/2015 9:59 PM, Tony Mechelynck wrote:
:set keymap=russian-jcukenwin
If you had e.g. a russian keyboard layout, you wouldn't be able to use |
On Thu, Dec 31, 2015 at 12:30 AM, Roland Puntaier
I see. Sounds like we need to: Best regards, |
Roland Puntaier wrote:
No, the langmap and keymap options relate to the keyboard. Replaying a
This is a bit vague... Perhaps the problem is that when recording into I look at keymap/langmap as a low level operation, which is applied when It's possible that this interferes with other things, such as terminal No letters of the alphabet were harmed in the creation of this message. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \ |
On 12/31/2015 6:22 PM, Bram Moolenaar (Vim Github Repository) wrote:
As of now is before i.e. the current code does not put the result of the keymap mapping into Since my last commit I have
I have also updated the documentation to mention:
Best Regards, Roland |
…ngmap); tests adapted
… with langmap as done in this pull
Hello Bram, I've seen the recently added (issues/572) test_langmap.vim's use of feedkeys(). That langmap should apply after feedkeys() does not fit Personally I'm favoring my solution, but not passionately (As I've mentioned I'm more interested Anyway it's up to you to decide. If you reject this pull request, Thanks. |
Roland Puntaier wrote:
Note that depending on flags feedkeys() inserts a bit earlier or not.
I haven't looked at your latest patch yet, but if langmap/keymap is Seen it all, done it all, can't remember most of it. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \ |
|
…mentation of langmap)
…terpret second byte of small russian р as K_SPECIAL
…e of russian p as K_SPECIAL
No comments for a long time. At least low-level testing with feedkeys() should work now. |
Any progress? |
I've debugged into vim and found the location, in which normal keymap application diverges when playing a register macro (@A).
It is in getchar.c: 2189
Both (no@a) and (@A) have
but only (@A) has: typebuf.tb_maplen > 0
Cited from getchar.c regarding the tb_maplen:
THE LAST TWO LINES COMMENTED AWAY MADE KEYMAP WORK WITH @A COMMANDS.
So before: no LANGMAP for @A. That's what ((mp->m_mode & LANGMAP) == 0 || typebuf.tb_maplen == 0) says, anyway.
With patch: LANGMAP for @A, i.e. without the condition.
tb_maplen is only set in ins_typebuf(), if the nottyped parameter is TRUE.
There are 12 such calls in check_abbr, do_execreg, exec_normal_cmd, server_to_input_buf, put_reedit_in_typebuf, put_in_typebuf.
As for abbreviation I found no difference in behavior before and after the patch.
Personally I would like to use KEYMAP with @A.
I also regard it as a general deficiency, when e.g. a russian guy cannot use @A to insert russian text.
But maybe there are unwanted side effects, I'm not aware of.
Bram, maybe you can think of side effects or know why this condition was put there in the first place.