mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 22:18:33 +00:00
vim-patch:7.4.502 #2282
Problem: Language mapping also applies to mapped characters. Solution: Add the 'langnoremap' option, when on 'langmap' does not apply to mapped characters. (Christian Brabandt) https://github.com/vim/vim/releases/tag/v7-4-502
This commit is contained in:

committed by
Justin M. Keyes

parent
9d02e5b984
commit
2c7e8c38e0
@@ -4351,6 +4351,16 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
:source $VIMRUNTIME/menu.vim
|
:source $VIMRUNTIME/menu.vim
|
||||||
< Warning: This deletes all menus that you defined yourself!
|
< Warning: This deletes all menus that you defined yourself!
|
||||||
|
|
||||||
|
*'langnoremap'* *'lnr'*
|
||||||
|
'langnoremap' 'lnr' boolean (default off)
|
||||||
|
global
|
||||||
|
{not in Vi}
|
||||||
|
When on, setting 'langmap' does not apply to characters resulting from
|
||||||
|
a mapping. This basically means, if you noticed that setting
|
||||||
|
'langmap' disables some of your mappings, try setting this option.
|
||||||
|
This option defaults to off for backwards compatibility. Set it on if
|
||||||
|
that works for you to avoid mappings to break.
|
||||||
|
|
||||||
*'laststatus'* *'ls'*
|
*'laststatus'* *'ls'*
|
||||||
'laststatus' 'ls' number (default 1)
|
'laststatus' 'ls' number (default 1)
|
||||||
global
|
global
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
" An example for a vimrc file.
|
" An example for a vimrc file.
|
||||||
"
|
"
|
||||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||||
" Last change: 2014 Feb 05
|
" Last change: 2014 Nov 05
|
||||||
"
|
"
|
||||||
" To use it, copy it to
|
" To use it, copy it to
|
||||||
" for Unix: ~/.vimrc
|
" for Unix: ~/.vimrc
|
||||||
@@ -80,3 +80,8 @@ if !exists(":DiffOrig")
|
|||||||
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
|
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
|
||||||
\ | wincmd p | diffthis
|
\ | wincmd p | diffthis
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Prevent that the langmap option applies to characters that result from a
|
||||||
|
" mapping. If unset (default), this may break plugins (but it's backward
|
||||||
|
" compatible).
|
||||||
|
set langnoremap
|
||||||
|
@@ -77,12 +77,17 @@
|
|||||||
* Adjust chars in a language according to 'langmap' option.
|
* Adjust chars in a language according to 'langmap' option.
|
||||||
* NOTE that there is no noticeable overhead if 'langmap' is not set.
|
* NOTE that there is no noticeable overhead if 'langmap' is not set.
|
||||||
* When set the overhead for characters < 256 is small.
|
* When set the overhead for characters < 256 is small.
|
||||||
* Don't apply 'langmap' if the character comes from the Stuff buffer.
|
* Don't apply 'langmap' if the character comes from the Stuff buffer or from a
|
||||||
|
* mapping and the langnoremap option was set.
|
||||||
* The do-while is just to ignore a ';' after the macro.
|
* The do-while is just to ignore a ';' after the macro.
|
||||||
*/
|
*/
|
||||||
# define LANGMAP_ADJUST(c, condition) \
|
# define LANGMAP_ADJUST(c, condition) \
|
||||||
do { \
|
do { \
|
||||||
if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0) \
|
if (*p_langmap \
|
||||||
|
&& (condition) \
|
||||||
|
&& (!p_lnr || (p_lnr && typebuf_maplen() == 0)) \
|
||||||
|
&& !KeyStuffed \
|
||||||
|
&& (c) >= 0) \
|
||||||
{ \
|
{ \
|
||||||
if ((c) < 256) \
|
if ((c) < 256) \
|
||||||
c = langmap_mapchar[c]; \
|
c = langmap_mapchar[c]; \
|
||||||
|
@@ -1027,6 +1027,9 @@ static vimoption_T
|
|||||||
{"langmenu", "lm", P_STRING|P_VI_DEF|P_NFNAME,
|
{"langmenu", "lm", P_STRING|P_VI_DEF|P_NFNAME,
|
||||||
(char_u *)&p_lm, PV_NONE,
|
(char_u *)&p_lm, PV_NONE,
|
||||||
{(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
|
{(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
|
||||||
|
{"langnoremap", "lnr", P_BOOL|P_VI_DEF,
|
||||||
|
(char_u *)&p_lnr, PV_NONE,
|
||||||
|
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||||
{"laststatus", "ls", P_NUM|P_VI_DEF|P_RALL,
|
{"laststatus", "ls", P_NUM|P_VI_DEF|P_RALL,
|
||||||
(char_u *)&p_ls, PV_NONE,
|
(char_u *)&p_ls, PV_NONE,
|
||||||
{(char_u *)1L, (char_u *)0L} SCRIPTID_INIT},
|
{(char_u *)1L, (char_u *)0L} SCRIPTID_INIT},
|
||||||
|
@@ -432,6 +432,7 @@ EXTERN int p_js; /* 'joinspaces' */
|
|||||||
EXTERN char_u *p_kp; /* 'keywordprg' */
|
EXTERN char_u *p_kp; /* 'keywordprg' */
|
||||||
EXTERN char_u *p_km; /* 'keymodel' */
|
EXTERN char_u *p_km; /* 'keymodel' */
|
||||||
EXTERN char_u *p_langmap; /* 'langmap'*/
|
EXTERN char_u *p_langmap; /* 'langmap'*/
|
||||||
|
EXTERN int p_lnr; /* 'langnoremap'*/
|
||||||
EXTERN char_u *p_lm; /* 'langmenu' */
|
EXTERN char_u *p_lm; /* 'langmenu' */
|
||||||
EXTERN char_u *p_lispwords; /* 'lispwords' */
|
EXTERN char_u *p_lispwords; /* 'lispwords' */
|
||||||
EXTERN long p_ls; /* 'laststatus' */
|
EXTERN long p_ls; /* 'laststatus' */
|
||||||
|
@@ -238,7 +238,7 @@ static int included_patches[] = {
|
|||||||
//505 NA
|
//505 NA
|
||||||
//504 NA
|
//504 NA
|
||||||
503,
|
503,
|
||||||
//502,
|
502,
|
||||||
//501 NA
|
//501 NA
|
||||||
500,
|
500,
|
||||||
499,
|
499,
|
||||||
|
Reference in New Issue
Block a user