On 26/02/09 04:21, Bram Moolenaar wrote:
> Tony Mechelynck wrote:
>
>> Bug? Seems so to me. even two of them (but both related to the 'keymap'
>> option).
>>
>> The one is in menu.vim (Last change: 2008 Aug 22): at lines 365 and 377
>> it uses ":set" rather than ":setlocal", which sets the keymap for _all_
>> future new buffers, not only the current one.
>
> Well, I would think most users actually expect this.  Otherwise you need
> to set the keymap for every buffer you open.  And usually people use the
> same keymap for multiple files.  Not all though, that's why the option
> is local to the buffer.

Some people use the same keymap on most on their files, but I would 
expect them to set that keymap in their vimrc, not by means of the "Edit 
=> Keymap ..." menu. Menus are for use when _departing_ from what was 
set in the vimrc, thus, I would expect, from the odd file using either a 
different keymap than the one usually in use, or some keymap when one 
usually uses none.

For most files (written in various variants of the Latin alphabet) I use 
no keymap and rely on my Belgian keyboard (with its multiple dead keys) 
or on digraphs to produce any non-ASCII characters I might need. Now and 
then, though, I use either a Russian or an Arabic keymap ("phonetic" 
variants I wrote myself) for texts in some non-Latin alphabet. It's 
unsettling (to say the least) to open a new buffer, start typing in it, 
and discover that one is typing in Cyrillic or Arabic script when Latin 
was expected.

>
>> The other is somewhere in the C code: setting 'keymap' (even locally)
>> changes the global default for 'iminsert' which is then set to 1,
>> clobbering any default set at compile-time (0) or in the vimrc (which
>> can be 2 on CJK locales). I would have expected ":setlocal
>> keymap=something" not to touch the 'iminsert' global value. (Setting the
>> _local_ value to 1 is OK, on the assumption that the user wants to
>> immediately start using the newly-set keymap _in the current buffer_.)
>
> Yes, both options are local to the buffer, so when using ":setlocal" on
> 'keymap' then the same should happen for 'iminsert'.  How about
> this patch:
[...]
Thanks, I'll try it.


Best regards,
Tony.
-- 
It is something to be able to paint a particular picture, or to carve a
statue, and so to make a few objects beautiful; but it is far more
glorious to carve and paint the very atmosphere and medium through
which we look, which morally we can do.  To affect the quality of the
day, that is the highest of arts.
                -- Henry David Thoreau, "Where I Live"

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui