jkunstle / rpms / vim

Forked from rpms/vim 3 years ago
Clone

Blame SOURCES/7.4.502

073263
To: vim_dev@googlegroups.com
073263
Subject: Patch 7.4.502
073263
Fcc: outbox
073263
From: Bram Moolenaar <Bram@moolenaar.net>
073263
Mime-Version: 1.0
073263
Content-Type: text/plain; charset=UTF-8
073263
Content-Transfer-Encoding: 8bit
073263
------------
073263
073263
Patch 7.4.502
073263
Problem:    Language mapping also applies to mapped characters.
073263
Solution:   Add the 'langnoremap' option, when on 'langmap' does not apply to
073263
	    mapped characters. (Christian Brabandt)
073263
Files:	    runtime/doc/options.txt, runtime/vimrc_example.vim, src/macros.h,
073263
	    src/option.c, src/option.h
073263
073263
073263
*** ../vim-7.4.501/runtime/doc/options.txt	2014-11-05 14:26:30.760758363 +0100
073263
--- runtime/doc/options.txt	2014-11-05 17:21:15.676505715 +0100
073263
***************
073263
*** 4533,4538 ****
073263
--- 4534,4543 ----
073263
  	be able to execute Normal mode commands.
073263
  	This is the opposite of the 'keymap' option, where characters are
073263
  	mapped in Insert mode.
073263
+ 	Also consider setting 'langnoremap' to avoid 'langmap' applies to
073263
+ 	characters resulting from a mapping.
073263
+ 	This option cannot be set from a |modeline| or in the |sandbox|, for
073263
+ 	security reasons.
073263
  
073263
  	Example (for Greek, in UTF-8):				*greek*  >
073263
  	    :set langmap=ΑA,ΒB,ΨC,ΔD,ΕE,ΦF,ΓG,ΗH,ΙI,ΞJ,ΚK,ΛL,ΜM,ΝN,ΟO,ΠP,QQ,ΡR,ΣS,ΤT,ΘU,ΩV,WW,ΧX,ΥY,ΖZ,αa,βb,ψc,δd,εe,φf,γg,ηh,ιi,ξj,κk,λl,μm,νn,οo,πp,qq,ρr,σs,τt,θu,ωv,ςw,χx,υy,ζz
073263
***************
073263
*** 4586,4591 ****
073263
--- 4591,4608 ----
073263
  		:source $VIMRUNTIME/menu.vim
073263
  <	Warning: This deletes all menus that you defined yourself!
073263
  
073263
+ 					*'langnoremap'* *'lnr'*
073263
+ 'langnoremap' 'lnr'	boolean (default off)
073263
+ 			global
073263
+ 			{not in Vi}
073263
+ 			{only available when compiled with the |+langmap|
073263
+ 			feature}
073263
+ 	When on, setting 'langmap' does not apply to characters resulting from
073263
+ 	a mapping.  This basically means, if you noticed that setting
073263
+ 	'langmap' disables some of your mappings, try setting this option.
073263
+ 	This option defaults to off for backwards compatibility.  Set it on if
073263
+ 	that works for you to avoid mappings to break.
073263
+ 
073263
  					*'laststatus'* *'ls'*
073263
  'laststatus' 'ls'	number	(default 1)
073263
  			global
073263
*** ../vim-7.4.501/runtime/vimrc_example.vim	2014-02-05 22:01:56.686546587 +0100
073263
--- runtime/vimrc_example.vim	2014-11-05 17:23:26.808502555 +0100
073263
***************
073263
*** 1,7 ****
073263
  " An example for a vimrc file.
073263
  "
073263
  " Maintainer:	Bram Moolenaar <Bram@vim.org>
073263
! " Last change:	2014 Feb 05
073263
  "
073263
  " To use it, copy it to
073263
  "     for Unix and OS/2:  ~/.vimrc
073263
--- 1,7 ----
073263
  " An example for a vimrc file.
073263
  "
073263
  " Maintainer:	Bram Moolenaar <Bram@vim.org>
073263
! " Last change:	2014 Nov 05
073263
  "
073263
  " To use it, copy it to
073263
  "     for Unix and OS/2:  ~/.vimrc
073263
***************
073263
*** 95,97 ****
073263
--- 95,104 ----
073263
    command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
073263
  		  \ | wincmd p | diffthis
073263
  endif
073263
+ 
073263
+ if has('langmap') && exists('+langnoremap')
073263
+   " Prevent that the langmap option applies to characters that result from a
073263
+   " mapping.  If unset (default), this may break plugins (but it's backward
073263
+   " compatible).
073263
+   set langnoremap
073263
+ endif
073263
*** ../vim-7.4.501/src/macros.h	2014-05-13 20:19:53.569808877 +0200
073263
--- src/macros.h	2014-11-05 17:26:42.172497848 +0100
073263
***************
073263
*** 128,140 ****
073263
   * Adjust chars in a language according to 'langmap' option.
073263
   * NOTE that there is no noticeable overhead if 'langmap' is not set.
073263
   * When set the overhead for characters < 256 is small.
073263
!  * Don't apply 'langmap' if the character comes from the Stuff buffer.
073263
   * The do-while is just to ignore a ';' after the macro.
073263
   */
073263
  # ifdef FEAT_MBYTE
073263
  #  define LANGMAP_ADJUST(c, condition) \
073263
      do { \
073263
! 	if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0) \
073263
  	{ \
073263
  	    if ((c) < 256) \
073263
  		c = langmap_mapchar[c]; \
073263
--- 128,145 ----
073263
   * Adjust chars in a language according to 'langmap' option.
073263
   * NOTE that there is no noticeable overhead if 'langmap' is not set.
073263
   * When set the overhead for characters < 256 is small.
073263
!  * Don't apply 'langmap' if the character comes from the Stuff buffer or from
073263
!  * a mapping and the langnoremap option was set.
073263
   * The do-while is just to ignore a ';' after the macro.
073263
   */
073263
  # ifdef FEAT_MBYTE
073263
  #  define LANGMAP_ADJUST(c, condition) \
073263
      do { \
073263
! 	if (*p_langmap \
073263
! 		&& (condition) \
073263
! 		&& (!p_lnr || (p_lnr && typebuf_maplen() == 0)) \
073263
! 		&& !KeyStuffed \
073263
! 		&& (c) >= 0) \
073263
  	{ \
073263
  	    if ((c) < 256) \
073263
  		c = langmap_mapchar[c]; \
073263
***************
073263
*** 145,151 ****
073263
  # else
073263
  #  define LANGMAP_ADJUST(c, condition) \
073263
      do { \
073263
! 	if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0 && (c) < 256) \
073263
  	    c = langmap_mapchar[c]; \
073263
      } while (0)
073263
  # endif
073263
--- 150,160 ----
073263
  # else
073263
  #  define LANGMAP_ADJUST(c, condition) \
073263
      do { \
073263
! 	if (*p_langmap \
073263
! 		&& (condition) \
073263
! 		&& (!p_lnr || (p_lnr && typebuf_maplen() == 0)) \
073263
! 		&& !KeyStuffed \
073263
! 		&& (c) >= 0 && (c) < 256) \
073263
  	    c = langmap_mapchar[c]; \
073263
      } while (0)
073263
  # endif
073263
*** ../vim-7.4.501/src/option.c	2014-09-29 17:15:09.963945227 +0200
073263
--- src/option.c	2014-11-05 17:17:44.208510810 +0100
073263
***************
073263
*** 1691,1696 ****
073263
--- 1691,1703 ----
073263
  			    (char_u *)NULL, PV_NONE,
073263
  #endif
073263
  			    {(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
073263
+     {"langnoremap",  "lnr",   P_BOOL|P_VI_DEF,
073263
+ #ifdef FEAT_LANGMAP
073263
+ 			    (char_u *)&p_lnr, PV_NONE,
073263
+ #else
073263
+ 			    (char_u *)NULL, PV_NONE,
073263
+ #endif
073263
+ 			    {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
073263
      {"laststatus",  "ls",   P_NUM|P_VI_DEF|P_RALL,
073263
  #ifdef FEAT_WINDOWS
073263
  			    (char_u *)&p_ls, PV_NONE,
073263
*** ../vim-7.4.501/src/option.h	2014-09-23 15:45:04.870801055 +0200
073263
--- src/option.h	2014-11-05 17:17:44.212510810 +0100
073263
***************
073263
*** 576,581 ****
073263
--- 576,582 ----
073263
  EXTERN char_u	*p_km;		/* 'keymodel' */
073263
  #ifdef FEAT_LANGMAP
073263
  EXTERN char_u	*p_langmap;	/* 'langmap'*/
073263
+ EXTERN int	p_lnr;		/* 'langnoremap' */
073263
  #endif
073263
  #if defined(FEAT_MENU) && defined(FEAT_MULTI_LANG)
073263
  EXTERN char_u	*p_lm;		/* 'langmenu' */
073263
*** ../vim-7.4.501/src/version.c	2014-11-05 17:04:10.516530418 +0100
073263
--- src/version.c	2014-11-05 17:15:31.820514001 +0100
073263
***************
073263
*** 743,744 ****
073263
--- 743,746 ----
073263
  {   /* Add new patch number below this line */
073263
+ /**/
073263
+     502,
073263
  /**/
073263
073263
-- 
073263
MARTHA'S WAY: Don't throw out all that leftover wine. Freeze into ice cubes
073263
              for future use in casseroles and sauces.
073263
MY WAY:       What leftover wine?
073263
073263
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
073263
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
073263
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
073263
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///