This patch negates effect of patch 7.3.1179 if 'waitforglobalmap' option is set.
# HG changeset patch
# User ZyX <[email protected]>
# Date 1371906075 -14400
# Sat Jun 22 17:01:15 2013 +0400
# Branch enable-waiting
# Node ID 32d2ee310c5c05b9f0da6a147c18946714b77937
# Parent 020c48b4fb47ebc06ce0658dc65b2705c7f7e27f
Add 'waitforglobalmap' option.
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -655,17 +655,18 @@
you type slowly, or your system is slow, reset the 'timeout' option. Then you
might want to set the 'ttimeout' option.
- *map-precedence*
-Buffer-local mappings (defined using |:map-<buffer>|) take precedence over
-global mappings. When a buffer-local mapping is the same as a global mapping,
-Vim will use the buffer-local mapping. In addition, Vim will use a complete
-buffer-local mapping immediately, even if a longer global mapping has the
-buffer-local mapping as a prefix. For example, given the following two
-mappings: >
+ *map-precedence*
+By default buffer-local mappings (defined using |:map-<buffer>|) take
+precedence over global mappings. When a buffer-local mapping is the same as
+a global mapping, Vim will use the buffer-local mapping. In addition, Vim
+will use a complete buffer-local mapping immediately, even if a longer global
+mapping has the buffer-local mapping as a prefix. For example, given the
+following two mappings: >
:map <buffer> \a :echo "Local \a"<CR>
:map \abc :echo "Global \abc"<CR>
The buffer-local mapping \a will be used immediately. Vim will not wait for
-more characters to see if the user might be typing \abc.
+more characters to see if the user might be typing \abc. This behavior is
+overridden by 'waitforglobalmap' option which will make vim wait for \abc.
*map-keys-fails*
There are situations where key codes might not be recognized:
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1808,9 +1808,8 @@
Keep in mind that the cursor position is not always where it's
displayed. E.g., when moving vertically it may change column.
-
-'conceallevel' 'cole' *'conceallevel'* *'cole'*
- number (default 0)
+ *'conceallevel'* *'cole'*
+'conceallevel' 'cole' number (default 0)
local to window
{not in Vi}
{not available when compiled without the |+conceal|
@@ -2186,7 +2185,7 @@
*'cryptmethod'* *'cm'*
-'cryptmethod' string (default "zip")
+'cryptmethod' 'cm' string (default "zip")
global or local to buffer |global-local|
{not in Vi}
Method used for encryption when the buffer is written to a file:
@@ -2235,7 +2234,7 @@
security reasons.
*'cscopequickfix'* *'csqf'*
-'cscopequickfix' 'csqf' string (default "")
+'cscopequickfix' 'csqf' string (default "")
global
{not available when compiled without the |+cscope|
or |+quickfix| features}
@@ -2244,7 +2243,7 @@
See |cscopequickfix|.
*'cscoperelative'* *'csre'* *'nocscoperelative'* *'nocsre'*
-'cscoperelative' 'csre' boolean (default off)
+'cscoperelative' 'csre' boolean (default off)
global
{not available when compiled without the |+cscope|
feature}
@@ -8247,4 +8246,13 @@
screen. When non-zero, characters are sent to the terminal one by
one. For MS-DOS pcterm this does not work. For debugging purposes.
+ *'waitforglobalmap'* *'wgm'*
+ *'nowaitforglobalmap'* *'nowgm'*
+'waitforglobalmap' 'wgm' boolean (default off)
+ global
+ {not in Vi}
+ If set wait for global mapping even if full buffer-local mapping was
+ already typed. Has effect if there is global mapping with lhs starting
+ with lhs of |:map-<buffer>| mapping. See also |map-precedence|.
+
vim:tw=78:ts=8:ft=help:norl:
diff --git a/src/getchar.c b/src/getchar.c
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -2131,7 +2131,8 @@
(mp = mp->m_next))
{
#ifdef FEAT_LOCALMAP
- if (expecting_global_mappings && mp2 == NULL)
+ if (!p_wgm
+ && expecting_global_mappings && mp2 == NULL)
{
/* This is the first global mapping. If we've
* got a complete buffer-local match, use it. */
diff --git a/src/option.c b/src/option.c
--- a/src/option.c
+++ b/src/option.c
@@ -2871,6 +2871,13 @@
{"writedelay", "wd", P_NUM|P_VI_DEF,
(char_u *)&p_wd, PV_NONE,
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
+ {"waitforglobalmap", "wgm", P_BOOL,
+#ifdef FEAT_LOCALMAP
+ (char_u *)&p_wgm, PV_NONE,
+#else
+ (char_u *)NULL, PV_NONE,
+#endif
+ {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
/* terminal output codes */
#define p_term(sss, vvv) {sss, NULL, P_STRING|P_VI_DEF|P_RALL|P_SECURE, \
diff --git a/src/option.h b/src/option.h
--- a/src/option.h
+++ b/src/option.h
@@ -904,6 +904,9 @@
EXTERN int p_wa; /* 'writeany' */
EXTERN int p_wb; /* 'writebackup' */
EXTERN long p_wd; /* 'writedelay' */
+#ifdef FEAT_LOCALMAP
+EXTERN int p_wgm; /* 'waitforglobalmap' */
+#endif
/*
* "indir" values for buffer-local opions.
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
diff -crN vim.020c48b4fb47/runtime/doc/map.txt vim.32d2ee310c5c/runtime/doc/map.txt
*** vim.020c48b4fb47/runtime/doc/map.txt 2013-06-22 17:02:31.559163534 +0400
--- vim.32d2ee310c5c/runtime/doc/map.txt 2013-06-22 17:02:31.601163134 +0400
***************
*** 655,671 ****
you type slowly, or your system is slow, reset the 'timeout' option. Then you
might want to set the 'ttimeout' option.
! *map-precedence*
! Buffer-local mappings (defined using |:map-<buffer>|) take precedence over
! global mappings. When a buffer-local mapping is the same as a global mapping,
! Vim will use the buffer-local mapping. In addition, Vim will use a complete
! buffer-local mapping immediately, even if a longer global mapping has the
! buffer-local mapping as a prefix. For example, given the following two
! mappings: >
:map <buffer> \a :echo "Local \a"<CR>
:map \abc :echo "Global \abc"<CR>
The buffer-local mapping \a will be used immediately. Vim will not wait for
! more characters to see if the user might be typing \abc.
*map-keys-fails*
There are situations where key codes might not be recognized:
--- 655,672 ----
you type slowly, or your system is slow, reset the 'timeout' option. Then you
might want to set the 'ttimeout' option.
! *map-precedence*
! By default buffer-local mappings (defined using |:map-<buffer>|) take
! precedence over global mappings. When a buffer-local mapping is the same as
! a global mapping, Vim will use the buffer-local mapping. In addition, Vim
! will use a complete buffer-local mapping immediately, even if a longer global
! mapping has the buffer-local mapping as a prefix. For example, given the
! following two mappings: >
:map <buffer> \a :echo "Local \a"<CR>
:map \abc :echo "Global \abc"<CR>
The buffer-local mapping \a will be used immediately. Vim will not wait for
! more characters to see if the user might be typing \abc. This behavior is
! overridden by 'waitforglobalmap' option which will make vim wait for \abc.
*map-keys-fails*
There are situations where key codes might not be recognized:
diff -crN vim.020c48b4fb47/runtime/doc/options.txt vim.32d2ee310c5c/runtime/doc/options.txt
*** vim.020c48b4fb47/runtime/doc/options.txt 2013-06-22 17:02:31.548163640 +0400
--- vim.32d2ee310c5c/runtime/doc/options.txt 2013-06-22 17:02:31.594163201 +0400
***************
*** 1808,1816 ****
Keep in mind that the cursor position is not always where it's
displayed. E.g., when moving vertically it may change column.
!
! 'conceallevel' 'cole' *'conceallevel'* *'cole'*
! number (default 0)
local to window
{not in Vi}
{not available when compiled without the |+conceal|
--- 1808,1815 ----
Keep in mind that the cursor position is not always where it's
displayed. E.g., when moving vertically it may change column.
! *'conceallevel'* *'cole'*
! 'conceallevel' 'cole' number (default 0)
local to window
{not in Vi}
{not available when compiled without the |+conceal|
***************
*** 2186,2192 ****
*'cryptmethod'* *'cm'*
! 'cryptmethod' string (default "zip")
global or local to buffer |global-local|
{not in Vi}
Method used for encryption when the buffer is written to a file:
--- 2185,2191 ----
*'cryptmethod'* *'cm'*
! 'cryptmethod' 'cm' string (default "zip")
global or local to buffer |global-local|
{not in Vi}
Method used for encryption when the buffer is written to a file:
***************
*** 2235,2241 ****
security reasons.
*'cscopequickfix'* *'csqf'*
! 'cscopequickfix' 'csqf' string (default "")
global
{not available when compiled without the |+cscope|
or |+quickfix| features}
--- 2234,2240 ----
security reasons.
*'cscopequickfix'* *'csqf'*
! 'cscopequickfix' 'csqf' string (default "")
global
{not available when compiled without the |+cscope|
or |+quickfix| features}
***************
*** 2244,2250 ****
See |cscopequickfix|.
*'cscoperelative'* *'csre'* *'nocscoperelative'* *'nocsre'*
! 'cscoperelative' 'csre' boolean (default off)
global
{not available when compiled without the |+cscope|
feature}
--- 2243,2249 ----
See |cscopequickfix|.
*'cscoperelative'* *'csre'* *'nocscoperelative'* *'nocsre'*
! 'cscoperelative' 'csre' boolean (default off)
global
{not available when compiled without the |+cscope|
feature}
***************
*** 8247,8250 ****
--- 8246,8258 ----
screen. When non-zero, characters are sent to the terminal one by
one. For MS-DOS pcterm this does not work. For debugging purposes.
+ *'waitforglobalmap'* *'wgm'*
+ *'nowaitforglobalmap'* *'nowgm'*
+ 'waitforglobalmap' 'wgm' boolean (default off)
+ global
+ {not in Vi}
+ If set wait for global mapping even if full buffer-local mapping was
+ already typed. Has effect if there is global mapping with lhs starting
+ with lhs of |:map-<buffer>| mapping. See also |map-precedence|.
+
vim:tw=78:ts=8:ft=help:norl:
diff -crN vim.020c48b4fb47/src/getchar.c vim.32d2ee310c5c/src/getchar.c
*** vim.020c48b4fb47/src/getchar.c 2013-06-22 17:02:31.561163517 +0400
--- vim.32d2ee310c5c/src/getchar.c 2013-06-22 17:02:31.597163171 +0400
***************
*** 2131,2137 ****
(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. */
--- 2131,2138 ----
(mp = mp->m_next))
{
#ifdef FEAT_LOCALMAP
! if (!p_wgm
! && expecting_global_mappings && mp2 == NULL)
{
/* This is the first global mapping. If we've
* got a complete buffer-local match, use it. */
diff -crN vim.020c48b4fb47/src/option.c vim.32d2ee310c5c/src/option.c
*** vim.020c48b4fb47/src/option.c 2013-06-22 17:02:31.555163575 +0400
--- vim.32d2ee310c5c/src/option.c 2013-06-22 17:02:31.607163078 +0400
***************
*** 2871,2876 ****
--- 2871,2883 ----
{"writedelay", "wd", P_NUM|P_VI_DEF,
(char_u *)&p_wd, PV_NONE,
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
+ {"waitforglobalmap", "wgm", P_BOOL,
+ #ifdef FEAT_LOCALMAP
+ (char_u *)&p_wgm, PV_NONE,
+ #else
+ (char_u *)NULL, PV_NONE,
+ #endif
+ {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
/* terminal output codes */
#define p_term(sss, vvv) {sss, NULL, P_STRING|P_VI_DEF|P_RALL|P_SECURE, \
diff -crN vim.020c48b4fb47/src/option.h vim.32d2ee310c5c/src/option.h
*** vim.020c48b4fb47/src/option.h 2013-06-22 17:02:31.556163564 +0400
--- vim.32d2ee310c5c/src/option.h 2013-06-22 17:02:31.599163153 +0400
***************
*** 904,909 ****
--- 904,912 ----
EXTERN int p_wa; /* 'writeany' */
EXTERN int p_wb; /* 'writebackup' */
EXTERN long p_wd; /* 'writedelay' */
+ #ifdef FEAT_LOCALMAP
+ EXTERN int p_wgm; /* 'waitforglobalmap' */
+ #endif
/*
* "indir" values for buffer-local opions.