Karsten Hopp 610cf4
To: vim-dev@vim.org
Karsten Hopp 610cf4
Subject: Patch 7.2.131
Karsten Hopp 610cf4
Fcc: outbox
Karsten Hopp 610cf4
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 610cf4
Mime-Version: 1.0
Karsten Hopp 610cf4
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp 610cf4
Content-Transfer-Encoding: 8bit
Karsten Hopp 610cf4
------------
Karsten Hopp 610cf4
Karsten Hopp 610cf4
Patch 7.2.131
Karsten Hopp 610cf4
Problem:    When 'keymap' is cleared may still use the cursor highlighting for
Karsten Hopp 610cf4
            when it's enabled.
Karsten Hopp 610cf4
Solution:   Reset 'iminsert' and 'imsearch'. (partly by Dominique Pelle)
Karsten Hopp 610cf4
            Also avoid ":setlocal" for these options have a global effect.
Karsten Hopp 610cf4
Files:      src/option.c
Karsten Hopp 610cf4
Karsten Hopp 610cf4
Karsten Hopp 610cf4
*** ../vim-7.2.130/src/option.c	Sat Feb 21 20:27:00 2009
Karsten Hopp 610cf4
--- src/option.c	Wed Mar  4 04:09:51 2009
Karsten Hopp 610cf4
***************
Karsten Hopp 610cf4
*** 5797,5810 ****
Karsten Hopp 610cf4
  	/* load or unload key mapping tables */
Karsten Hopp 610cf4
  	errmsg = keymap_init();
Karsten Hopp 610cf4
  
Karsten Hopp 610cf4
! 	/* When successfully installed a new keymap switch on using it. */
Karsten Hopp 610cf4
! 	if (*curbuf->b_p_keymap != NUL && errmsg == NULL)
Karsten Hopp 610cf4
  	{
Karsten Hopp 610cf4
! 	    curbuf->b_p_iminsert = B_IMODE_LMAP;
Karsten Hopp 610cf4
! 	    if (curbuf->b_p_imsearch != B_IMODE_USE_INSERT)
Karsten Hopp 610cf4
! 		curbuf->b_p_imsearch = B_IMODE_LMAP;
Karsten Hopp 610cf4
! 	    set_iminsert_global();
Karsten Hopp 610cf4
! 	    set_imsearch_global();
Karsten Hopp 610cf4
  # ifdef FEAT_WINDOWS
Karsten Hopp 610cf4
  	    status_redraw_curbuf();
Karsten Hopp 610cf4
  # endif
Karsten Hopp 610cf4
--- 5797,5824 ----
Karsten Hopp 610cf4
  	/* load or unload key mapping tables */
Karsten Hopp 610cf4
  	errmsg = keymap_init();
Karsten Hopp 610cf4
  
Karsten Hopp 610cf4
! 	if (errmsg == NULL)
Karsten Hopp 610cf4
  	{
Karsten Hopp 610cf4
! 	    if (*curbuf->b_p_keymap != NUL)
Karsten Hopp 610cf4
! 	    {
Karsten Hopp 610cf4
! 		/* Installed a new keymap, switch on using it. */
Karsten Hopp 610cf4
! 		curbuf->b_p_iminsert = B_IMODE_LMAP;
Karsten Hopp 610cf4
! 		if (curbuf->b_p_imsearch != B_IMODE_USE_INSERT)
Karsten Hopp 610cf4
! 		    curbuf->b_p_imsearch = B_IMODE_LMAP;
Karsten Hopp 610cf4
! 	    }
Karsten Hopp 610cf4
! 	    else
Karsten Hopp 610cf4
! 	    {
Karsten Hopp 610cf4
! 		/* Cleared the keymap, may reset 'iminsert' and 'imsearch'. */
Karsten Hopp 610cf4
! 		if (curbuf->b_p_iminsert == B_IMODE_LMAP)
Karsten Hopp 610cf4
! 		    curbuf->b_p_iminsert = B_IMODE_NONE;
Karsten Hopp 610cf4
! 		if (curbuf->b_p_imsearch == B_IMODE_LMAP)
Karsten Hopp 610cf4
! 		    curbuf->b_p_imsearch = B_IMODE_USE_INSERT;
Karsten Hopp 610cf4
! 	    }
Karsten Hopp 610cf4
! 	    if ((opt_flags & OPT_LOCAL) == 0)
Karsten Hopp 610cf4
! 	    {
Karsten Hopp 610cf4
! 		set_iminsert_global();
Karsten Hopp 610cf4
! 		set_imsearch_global();
Karsten Hopp 610cf4
! 	    }
Karsten Hopp 610cf4
  # ifdef FEAT_WINDOWS
Karsten Hopp 610cf4
  	    status_redraw_curbuf();
Karsten Hopp 610cf4
  # endif
Karsten Hopp 610cf4
*** ../vim-7.2.130/src/version.c	Mon Mar  2 02:44:54 2009
Karsten Hopp 610cf4
--- src/version.c	Wed Mar  4 04:10:32 2009
Karsten Hopp 610cf4
***************
Karsten Hopp 610cf4
*** 678,679 ****
Karsten Hopp 610cf4
--- 678,681 ----
Karsten Hopp 610cf4
  {   /* Add new patch number below this line */
Karsten Hopp 610cf4
+ /**/
Karsten Hopp 610cf4
+     131,
Karsten Hopp 610cf4
  /**/
Karsten Hopp 610cf4
Karsten Hopp 610cf4
-- 
Karsten Hopp 610cf4
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 610cf4
157. You fum through a magazine, you first check to see if it has a web
Karsten Hopp 610cf4
     address.
Karsten Hopp 610cf4
Karsten Hopp 610cf4
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 610cf4
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 610cf4
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 610cf4
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///