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.

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

*** ../vim-7.2.127/src/option.c Sat Feb 21 20:27:00 2009
--- src/option.c        Thu Feb 26 04:10:36 2009
***************
*** 5803,5810 ****
            curbuf->b_p_iminsert = B_IMODE_LMAP;
            if (curbuf->b_p_imsearch != B_IMODE_USE_INSERT)
                curbuf->b_p_imsearch = B_IMODE_LMAP;
!           set_iminsert_global();
!           set_imsearch_global();
  # ifdef FEAT_WINDOWS
            status_redraw_curbuf();
  # endif
--- 5803,5813 ----
            curbuf->b_p_iminsert = B_IMODE_LMAP;
            if (curbuf->b_p_imsearch != B_IMODE_USE_INSERT)
                curbuf->b_p_imsearch = B_IMODE_LMAP;
!           if ((opt_flags & OPT_LOCAL) == 0)
!           {
!               set_iminsert_global();
!               set_imsearch_global();
!           }
  # ifdef FEAT_WINDOWS
            status_redraw_curbuf();
  # endif


-- 
In a world without fences, who needs Gates and Windows?

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

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

Raspunde prin e-mail lui