summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-06-12 21:00:26 +0200
committerBram Moolenaar <Bram@vim.org>2013-06-12 21:00:26 +0200
commit0825c00f14bb60202bcd0391bc3f0eba4d188aac (patch)
tree124d723e66c3e7dfeee62808b5cf6ad97b39a787
parent22971aaa4530d6e8cb2c9c0c19b4f291d8442d61 (diff)
downloadvim-git-0825c00f14bb60202bcd0391bc3f0eba4d188aac.tar.gz
updated for version 7.3.1179v7.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)
-rw-r--r--src/getchar.c12
-rw-r--r--src/version.c2
2 files changed, 14 insertions, 0 deletions
diff --git a/src/getchar.c b/src/getchar.c
index 946e757d6..e24a6abcf 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -1924,6 +1924,7 @@ vgetorpeek(advance)
mapblock_T *mp;
#ifdef FEAT_LOCALMAP
mapblock_T *mp2;
+ int expecting_global_mappings;
#endif
mapblock_T *mp_match;
int mp_match_len = 0;
@@ -2105,6 +2106,7 @@ vgetorpeek(advance)
/* First try buffer-local mappings. */
mp = curbuf->b_maphash[MAP_HASH(local_State, c1)];
mp2 = maphash[MAP_HASH(local_State, c1)];
+ expecting_global_mappings = (mp && mp2);
if (mp == NULL)
{
mp = mp2;
@@ -2128,6 +2130,16 @@ vgetorpeek(advance)
#endif
(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
* matches and it is for the current state.
diff --git a/src/version.c b/src/version.c
index 32a81cfe2..e7f399b80 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1179,
+/**/
1178,
/**/
1177,