jkunstle / rpms / vim

Forked from rpms/vim 3 years ago
Clone

Blame SOURCES/7.4.502

3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.502
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.502
3ef2ca
Problem:    Language mapping also applies to mapped characters.
3ef2ca
Solution:   Add the 'langnoremap' option, when on 'langmap' does not apply to
3ef2ca
	    mapped characters. (Christian Brabandt)
3ef2ca
Files:	    runtime/doc/options.txt, runtime/vimrc_example.vim, src/macros.h,
3ef2ca
	    src/option.c, src/option.h
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.501/runtime/doc/options.txt	2014-11-05 14:26:30.760758363 +0100
3ef2ca
--- runtime/doc/options.txt	2014-11-05 17:21:15.676505715 +0100
3ef2ca
***************
3ef2ca
*** 4533,4538 ****
3ef2ca
--- 4534,4543 ----
3ef2ca
  	be able to execute Normal mode commands.
3ef2ca
  	This is the opposite of the 'keymap' option, where characters are
3ef2ca
  	mapped in Insert mode.
3ef2ca
+ 	Also consider setting 'langnoremap' to avoid 'langmap' applies to
3ef2ca
+ 	characters resulting from a mapping.
3ef2ca
+ 	This option cannot be set from a |modeline| or in the |sandbox|, for
3ef2ca
+ 	security reasons.
3ef2ca
  
3ef2ca
  	Example (for Greek, in UTF-8):				*greek*  >
3ef2ca
  	    :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
3ef2ca
***************
3ef2ca
*** 4586,4591 ****
3ef2ca
--- 4591,4608 ----
3ef2ca
  		:source $VIMRUNTIME/menu.vim
3ef2ca
  <	Warning: This deletes all menus that you defined yourself!
3ef2ca
  
3ef2ca
+ 					*'langnoremap'* *'lnr'*
3ef2ca
+ 'langnoremap' 'lnr'	boolean (default off)
3ef2ca
+ 			global
3ef2ca
+ 			{not in Vi}
3ef2ca
+ 			{only available when compiled with the |+langmap|
3ef2ca
+ 			feature}
3ef2ca
+ 	When on, setting 'langmap' does not apply to characters resulting from
3ef2ca
+ 	a mapping.  This basically means, if you noticed that setting
3ef2ca
+ 	'langmap' disables some of your mappings, try setting this option.
3ef2ca
+ 	This option defaults to off for backwards compatibility.  Set it on if
3ef2ca
+ 	that works for you to avoid mappings to break.
3ef2ca
+ 
3ef2ca
  					*'laststatus'* *'ls'*
3ef2ca
  'laststatus' 'ls'	number	(default 1)
3ef2ca
  			global
3ef2ca
*** ../vim-7.4.501/runtime/vimrc_example.vim	2014-02-05 22:01:56.686546587 +0100
3ef2ca
--- runtime/vimrc_example.vim	2014-11-05 17:23:26.808502555 +0100
3ef2ca
***************
3ef2ca
*** 1,7 ****
3ef2ca
  " An example for a vimrc file.
3ef2ca
  "
3ef2ca
  " Maintainer:	Bram Moolenaar <Bram@vim.org>
3ef2ca
! " Last change:	2014 Feb 05
3ef2ca
  "
3ef2ca
  " To use it, copy it to
3ef2ca
  "     for Unix and OS/2:  ~/.vimrc
3ef2ca
--- 1,7 ----
3ef2ca
  " An example for a vimrc file.
3ef2ca
  "
3ef2ca
  " Maintainer:	Bram Moolenaar <Bram@vim.org>
3ef2ca
! " Last change:	2014 Nov 05
3ef2ca
  "
3ef2ca
  " To use it, copy it to
3ef2ca
  "     for Unix and OS/2:  ~/.vimrc
3ef2ca
***************
3ef2ca
*** 95,97 ****
3ef2ca
--- 95,104 ----
3ef2ca
    command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
3ef2ca
  		  \ | wincmd p | diffthis
3ef2ca
  endif
3ef2ca
+ 
3ef2ca
+ if has('langmap') && exists('+langnoremap')
3ef2ca
+   " Prevent that the langmap option applies to characters that result from a
3ef2ca
+   " mapping.  If unset (default), this may break plugins (but it's backward
3ef2ca
+   " compatible).
3ef2ca
+   set langnoremap
3ef2ca
+ endif
3ef2ca
*** ../vim-7.4.501/src/macros.h	2014-05-13 20:19:53.569808877 +0200
3ef2ca
--- src/macros.h	2014-11-05 17:26:42.172497848 +0100
3ef2ca
***************
3ef2ca
*** 128,140 ****
3ef2ca
   * Adjust chars in a language according to 'langmap' option.
3ef2ca
   * NOTE that there is no noticeable overhead if 'langmap' is not set.
3ef2ca
   * When set the overhead for characters < 256 is small.
3ef2ca
!  * Don't apply 'langmap' if the character comes from the Stuff buffer.
3ef2ca
   * The do-while is just to ignore a ';' after the macro.
3ef2ca
   */
3ef2ca
  # ifdef FEAT_MBYTE
3ef2ca
  #  define LANGMAP_ADJUST(c, condition) \
3ef2ca
      do { \
3ef2ca
! 	if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0) \
3ef2ca
  	{ \
3ef2ca
  	    if ((c) < 256) \
3ef2ca
  		c = langmap_mapchar[c]; \
3ef2ca
--- 128,145 ----
3ef2ca
   * Adjust chars in a language according to 'langmap' option.
3ef2ca
   * NOTE that there is no noticeable overhead if 'langmap' is not set.
3ef2ca
   * When set the overhead for characters < 256 is small.
3ef2ca
!  * Don't apply 'langmap' if the character comes from the Stuff buffer or from
3ef2ca
!  * a mapping and the langnoremap option was set.
3ef2ca
   * The do-while is just to ignore a ';' after the macro.
3ef2ca
   */
3ef2ca
  # ifdef FEAT_MBYTE
3ef2ca
  #  define LANGMAP_ADJUST(c, condition) \
3ef2ca
      do { \
3ef2ca
! 	if (*p_langmap \
3ef2ca
! 		&& (condition) \
3ef2ca
! 		&& (!p_lnr || (p_lnr && typebuf_maplen() == 0)) \
3ef2ca
! 		&& !KeyStuffed \
3ef2ca
! 		&& (c) >= 0) \
3ef2ca
  	{ \
3ef2ca
  	    if ((c) < 256) \
3ef2ca
  		c = langmap_mapchar[c]; \
3ef2ca
***************
3ef2ca
*** 145,151 ****
3ef2ca
  # else
3ef2ca
  #  define LANGMAP_ADJUST(c, condition) \
3ef2ca
      do { \
3ef2ca
! 	if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0 && (c) < 256) \
3ef2ca
  	    c = langmap_mapchar[c]; \
3ef2ca
      } while (0)
3ef2ca
  # endif
3ef2ca
--- 150,160 ----
3ef2ca
  # else
3ef2ca
  #  define LANGMAP_ADJUST(c, condition) \
3ef2ca
      do { \
3ef2ca
! 	if (*p_langmap \
3ef2ca
! 		&& (condition) \
3ef2ca
! 		&& (!p_lnr || (p_lnr && typebuf_maplen() == 0)) \
3ef2ca
! 		&& !KeyStuffed \
3ef2ca
! 		&& (c) >= 0 && (c) < 256) \
3ef2ca
  	    c = langmap_mapchar[c]; \
3ef2ca
      } while (0)
3ef2ca
  # endif
3ef2ca
*** ../vim-7.4.501/src/option.c	2014-09-29 17:15:09.963945227 +0200
3ef2ca
--- src/option.c	2014-11-05 17:17:44.208510810 +0100
3ef2ca
***************
3ef2ca
*** 1691,1696 ****
3ef2ca
--- 1691,1703 ----
3ef2ca
  			    (char_u *)NULL, PV_NONE,
3ef2ca
  #endif
3ef2ca
  			    {(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
3ef2ca
+     {"langnoremap",  "lnr",   P_BOOL|P_VI_DEF,
3ef2ca
+ #ifdef FEAT_LANGMAP
3ef2ca
+ 			    (char_u *)&p_lnr, PV_NONE,
3ef2ca
+ #else
3ef2ca
+ 			    (char_u *)NULL, PV_NONE,
3ef2ca
+ #endif
3ef2ca
+ 			    {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
3ef2ca
      {"laststatus",  "ls",   P_NUM|P_VI_DEF|P_RALL,
3ef2ca
  #ifdef FEAT_WINDOWS
3ef2ca
  			    (char_u *)&p_ls, PV_NONE,
3ef2ca
*** ../vim-7.4.501/src/option.h	2014-09-23 15:45:04.870801055 +0200
3ef2ca
--- src/option.h	2014-11-05 17:17:44.212510810 +0100
3ef2ca
***************
3ef2ca
*** 576,581 ****
3ef2ca
--- 576,582 ----
3ef2ca
  EXTERN char_u	*p_km;		/* 'keymodel' */
3ef2ca
  #ifdef FEAT_LANGMAP
3ef2ca
  EXTERN char_u	*p_langmap;	/* 'langmap'*/
3ef2ca
+ EXTERN int	p_lnr;		/* 'langnoremap' */
3ef2ca
  #endif
3ef2ca
  #if defined(FEAT_MENU) && defined(FEAT_MULTI_LANG)
3ef2ca
  EXTERN char_u	*p_lm;		/* 'langmenu' */
3ef2ca
*** ../vim-7.4.501/src/version.c	2014-11-05 17:04:10.516530418 +0100
3ef2ca
--- src/version.c	2014-11-05 17:15:31.820514001 +0100
3ef2ca
***************
3ef2ca
*** 743,744 ****
3ef2ca
--- 743,746 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     502,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
MARTHA'S WAY: Don't throw out all that leftover wine. Freeze into ice cubes
3ef2ca
              for future use in casseroles and sauces.
3ef2ca
MY WAY:       What leftover wine?
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///