mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
updated for version 7.3.1179
Problem: When a global mapping starts with the same characters as a buffer-local mapping Vim waits for a character to be typed to find out whether the global mapping is to be used. (Andy Wokula) Solution: Use the local mapping without waiting. (Michael Henry)
This commit is contained in:
parent
22971aaa45
commit
0825c00f14
@ -1924,6 +1924,7 @@ vgetorpeek(advance)
|
|||||||
mapblock_T *mp;
|
mapblock_T *mp;
|
||||||
#ifdef FEAT_LOCALMAP
|
#ifdef FEAT_LOCALMAP
|
||||||
mapblock_T *mp2;
|
mapblock_T *mp2;
|
||||||
|
int expecting_global_mappings;
|
||||||
#endif
|
#endif
|
||||||
mapblock_T *mp_match;
|
mapblock_T *mp_match;
|
||||||
int mp_match_len = 0;
|
int mp_match_len = 0;
|
||||||
@ -2105,6 +2106,7 @@ vgetorpeek(advance)
|
|||||||
/* First try buffer-local mappings. */
|
/* First try buffer-local mappings. */
|
||||||
mp = curbuf->b_maphash[MAP_HASH(local_State, c1)];
|
mp = curbuf->b_maphash[MAP_HASH(local_State, c1)];
|
||||||
mp2 = maphash[MAP_HASH(local_State, c1)];
|
mp2 = maphash[MAP_HASH(local_State, c1)];
|
||||||
|
expecting_global_mappings = (mp && mp2);
|
||||||
if (mp == NULL)
|
if (mp == NULL)
|
||||||
{
|
{
|
||||||
mp = mp2;
|
mp = mp2;
|
||||||
@ -2128,6 +2130,16 @@ vgetorpeek(advance)
|
|||||||
#endif
|
#endif
|
||||||
(mp = mp->m_next))
|
(mp = mp->m_next))
|
||||||
{
|
{
|
||||||
|
#ifdef FEAT_LOCALMAP
|
||||||
|
if (expecting_global_mappings && mp2 == NULL)
|
||||||
|
{
|
||||||
|
/* This is the first global mapping. If we've
|
||||||
|
* got a complete buffer-local match, use it. */
|
||||||
|
if (mp_match)
|
||||||
|
break;
|
||||||
|
expecting_global_mappings = FALSE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
* Only consider an entry if the first character
|
* Only consider an entry if the first character
|
||||||
* matches and it is for the current state.
|
* matches and it is for the current state.
|
||||||
|
@ -728,6 +728,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1179,
|
||||||
/**/
|
/**/
|
||||||
1178,
|
1178,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user