On 18/06/11 19:52, Ian Liu Rodrigues wrote:
Dear list,

When I press ALT_C in GVim, it generates the character "ã" (a tilde).
This is problematic since I can't create an imap to ALT_C, for typing
"ã" will also trigger the mapping.

I'm interested in fixing this bug and providing a patch, but I've never
looked in Vim's code, so if someone could give me an entry point, I
would appreciate.

Cheers,
Ian L.

It's not a bug, it's a feature.

Alt+ something is represented in Vim by setting the high bit, so Alt+c (0x80 + 0x63) and ã (0xE3) are identical. This is known, backward-compatible and documented: see :help :map-alt-keys

If you map something to <M-c>, ã will trigger it, and vice-versa.

Similarly, in another range, if you map something to <C-I>, <Tab> will trigger it and vice-versa.

Morality: If you need to type in Portuguese, don't map Alt-c in Insert mode (in Normal more it usually won't matter). You shouldn't use Insert-mode Alt-u either, because that's synonymous with õ (o-tilde).

If you weren't typing Portuguese but for instance English or French, with only occasional use of Portuguese diacritics in a very few foreign names, you could then, perhaps, apply the mapping anyway, and use Ctrl-V followed by ã or by õ when you needed the Portuguese letter. But I don't recommend it for Portuguese since it would break your typing too much. What I recommend for Portuguese is to find a different {lhs}.


Best regards,
Tony.
--
"I like work ... I can sit and watch it for hours."

--
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

Raspunde prin e-mail lui