-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On October 15, 2014 7:22:16 PM GMT+03:00, Christian Brabandt 
<[email protected]> wrote:
>Bram,
>what is the reason, setting 'lmap' applies to when a mapping is
>remapped?
>
>Consider this:
>~$ cat lmap.vim
>imap <tab> <Plug>MyPluginEcho
>imap <Plug>MyPluginEcho <c-r>="hello"<cr>
>cmap <tab> <Plug>MyPluginEcho
>cmap <Plug>MyPluginEcho <c-r>="hello"<cr>
>" set lmap=i;k
>
>run vim -u lmap.vim -N
>and type <tab> in insert mode, note, how "hello" is printed in either
>insert mode or command line mode.
>Now do
>:set lmap=i;k
>and do it again. Note that <Plug>MyPluginEcho will be output.
>
>The problem is, setting lmap breaks plugins (see e.g. here:
>http://stackoverflow.com/questions/12450803)
>
>I would consider this is a bug and actually think, that setting 'lmap'
>should
>never be applied to when recursively resolving a mapping.
>
>Also, I do not understand what this part of the help is trying to say:
>
>,----[ :h 'lmap' ]-
>| This will allow you to activate vim actions without having to switch
>| back and forth between the languages.  Your language characters will
>| be understood as normal vim English characters (according to the
>| langmap mappings) in the following cases:
>|  o Normal/Visual mode (commands, buffer/register names, user
>mappings)
>|  o Insert/Replace Mode: Register names after CTRL-R
>|  o Insert/Replace Mode: Mappings
>| Characters entered in Command-line mode will NOT be affected by
>| this option.   Note that this option can be changed at any time
>| allowing to switch between mappings for different
>languages/encodings.
>| Use a mapping to avoid having to type it each time!
>`----
>
>What are the language characters? What is the relationship to lmap
>mappings?
>
>This patch could fix it, but I am not sure, this fixes it correctly.
>
>diff --git a/src/getchar.c b/src/getchar.c
>--- a/src/getchar.c
>+++ b/src/getchar.c
>@@ -2196,12 +2196,16 @@ vgetorpeek(advance)
>                                {
> #ifdef FEAT_LANGMAP
>                            c2 = typebuf.tb_buf[typebuf.tb_off + mlen];
>-                                   if (nomap > 0)
>-                                       --nomap;
>-                                   else if (c2 == K_SPECIAL)
>-                                       nomap = 2;
>-                                   else
>-                                       LANGMAP_ADJUST(c2, TRUE);
>+                                   /* do not apply lmap setting when
>resolving a mapping */
>+                                   if (typebuf_maplen() !=
>typebuf.tb_len)
>+                                   {
>+                                       if (nomap > 0)
>+                                           --nomap;
>+                                       else if (c2 == K_SPECIAL)
>+                                           nomap = 2;
>+                                       else
>+                                           LANGMAP_ADJUST(c2, TRUE);
>+                                   }
>                                    if (mp->m_keys[mlen] != c2)
> #else
>                                    if (mp->m_keys[mlen] !=
>
>
>
>Mit freundlichen Grüßen
>Christian
>--
>Letzte Worte eines Dachdeckers:
>  "Mensch ist das heute ein Wind"
>
>--
>--
>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/d/optout.

This problem was already reported at least once. Do not remember any patches 
though.
-----BEGIN PGP SIGNATURE-----
Version: APG v1.1.1

iQI1BAEBCgAfBQJUPpinGBxaeVggPHp5eC52aW1AZ21haWwuY29tPgAKCRCf3UKj
HhHSvu3cD/9xrJmNrYXD3E2N13YZNJRG8Xns92yJrV7WDN5i5lu9sRBsGGgClLwK
UojjCCJNPPvUwZnLzzt1GzLBBjzOfQ2+E9KoJ0s0LJzyD8nsHJJyGq8sDuvPznwQ
vhOkLfcPp5G2/BejwxSF1ibkYKT78bHPbCOGvstO/QT5JvJhorjde8iVMLkkKOSs
30oUv4FjFePH0PPWRtBoGk9gqYe1JGm0McJwrRx+yigVzMWvPeRv2T2VWUZcCvoP
ecvXRxyKEIKY/57TNFOsdHDjSWYm4+vOHSmLYu/koNlHWmf2gRRB5TElxdx5WZ0d
S0dnrC3NQwNYygK8oS6ch9k2le4SVsatcyasa1N4Cc/0LuAOi7+gtdHVm3E5V2tq
IJZauhiJfTr4GA4482WeYCmYXcDggIfZIuO/Tl7vYGqRNAKr89OmghWEL85+xr/V
p2JmVssvIxQ7gzEyaeSbWIDLnP8Iv9tlXtOYJKo5rBhbzhKZAJTo6yIjhV3ssrQH
/ifLX8rwrZTR2m0OOenwTtz9A1mIOponrLwMWUMy+zdCpCQm7XuGZu3Tkn44UqLX
dx3ggJEyx9QFvMNHwNJwkGFSBHSmGjrIouPNll8uU2nkk0Ad7ADBlvTsw8malG+d
h+AKcGOuXoZJtDq43hJbN75NnFnB71aPl6Q8mSyyMVScnmuqmufn4Q==
=FERe
-----END PGP SIGNATURE-----

-- 
-- 
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/d/optout.

Raspunde prin e-mail lui