summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/digraph.c6
-rw-r--r--src/edit.c19
-rw-r--r--src/ex_cmds.c4
-rw-r--r--src/ex_getln.c6
-rw-r--r--src/getchar.c23
-rw-r--r--src/normal.c16
-rw-r--r--src/proto/getchar.pro1
-rw-r--r--src/version.c2
-rw-r--r--src/window.c2
9 files changed, 48 insertions, 31 deletions
diff --git a/src/digraph.c b/src/digraph.c
index e557680ec..a0f16273d 100644
--- a/src/digraph.c
+++ b/src/digraph.c
@@ -2028,7 +2028,7 @@ get_digraph(cmdline)
++no_mapping;
++allow_keys;
- c = safe_vgetc();
+ c = plain_vgetc();
--no_mapping;
--allow_keys;
if (c != ESC) /* ESC cancels CTRL-K */
@@ -2050,7 +2050,7 @@ get_digraph(cmdline)
#endif
++no_mapping;
++allow_keys;
- cc = safe_vgetc();
+ cc = plain_vgetc();
--no_mapping;
--allow_keys;
if (cc != ESC) /* ESC cancels CTRL-K */
@@ -2350,7 +2350,7 @@ keymap_init()
if (*curbuf->b_p_keymap == NUL)
{
/* Stop any active keymap and clear the table. Also remove
- * b:keymap_unload, as no keymap is active now. */
+ * b:keymap_name, as no keymap is active now. */
keymap_unload();
do_cmdline_cmd((char_u *)"unlet! b:keymap_name");
}
diff --git a/src/edit.c b/src/edit.c
index e5e0522f7..2cdf532dd 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -788,7 +788,7 @@ edit(cmdchar, startln, count)
ins_redraw(FALSE);
++no_mapping;
++allow_keys;
- c = safe_vgetc();
+ c = plain_vgetc();
--no_mapping;
--allow_keys;
if (c != Ctrl_N && c != Ctrl_G && c != Ctrl_O)
@@ -981,7 +981,7 @@ doESCkey:
#ifdef FEAT_NETBEANS_INTG
case K_F21: /* NetBeans command */
++no_mapping; /* don't map the next key hits */
- i = safe_vgetc();
+ i = plain_vgetc();
--no_mapping;
netbeans_keycommand(i);
break;
@@ -5224,10 +5224,7 @@ get_literal()
i = 0;
for (;;)
{
- do
- nc = safe_vgetc();
- while (nc == K_IGNORE || nc == K_VER_SCROLLBAR
- || nc == K_HOR_SCROLLBAR);
+ nc = plain_vgetc();
#ifdef FEAT_CMDL_INFO
if (!(State & CMDLINE)
# ifdef FEAT_MBYTE
@@ -7575,7 +7572,7 @@ ins_reg()
* deleted when ESC is hit.
*/
++no_mapping;
- regname = safe_vgetc();
+ regname = plain_vgetc();
#ifdef FEAT_LANGMAP
LANGMAP_ADJUST(regname, TRUE);
#endif
@@ -7586,7 +7583,7 @@ ins_reg()
#ifdef FEAT_CMDL_INFO
add_to_showcmd_c(literally);
#endif
- regname = safe_vgetc();
+ regname = plain_vgetc();
#ifdef FEAT_LANGMAP
LANGMAP_ADJUST(regname, TRUE);
#endif
@@ -7677,7 +7674,7 @@ ins_ctrl_g()
* deleted when ESC is hit.
*/
++no_mapping;
- c = safe_vgetc();
+ c = plain_vgetc();
--no_mapping;
switch (c)
{
@@ -9356,7 +9353,7 @@ ins_digraph()
* mode message to be deleted when ESC is hit */
++no_mapping;
++allow_keys;
- c = safe_vgetc();
+ c = plain_vgetc();
--no_mapping;
--allow_keys;
if (IS_SPECIAL(c) || mod_mask) /* special key */
@@ -9388,7 +9385,7 @@ ins_digraph()
}
++no_mapping;
++allow_keys;
- cc = safe_vgetc();
+ cc = plain_vgetc();
--no_mapping;
--allow_keys;
if (cc != ESC)
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 958f3abd3..32de57610 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -4498,7 +4498,7 @@ do_sub(eap)
*
* The new text is built up in new_start[]. It has some extra
* room to avoid using alloc()/free() too often. new_start_len is
- * the lenght of the allocated memory at new_start.
+ * the length of the allocated memory at new_start.
*
* Make a copy of the old line, so it won't be taken away when
* updating the screen or handling a multi-line match. The "old_"
@@ -4669,7 +4669,7 @@ do_sub(eap)
#endif
++no_mapping; /* don't map this key */
++allow_keys; /* allow special keys */
- i = safe_vgetc();
+ i = plain_vgetc();
--allow_keys;
--no_mapping;
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 3ddec2960..4a311b4c1 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -641,7 +641,7 @@ getcmdline(firstc, count, indent)
{
++no_mapping;
++allow_keys;
- c = safe_vgetc();
+ c = plain_vgetc();
--no_mapping;
--allow_keys;
/* CTRL-\ e doesn't work when obtaining an expression. */
@@ -1091,11 +1091,11 @@ getcmdline(firstc, count, indent)
#endif
putcmdline('"', TRUE);
++no_mapping;
- i = c = safe_vgetc(); /* CTRL-R <char> */
+ i = c = plain_vgetc(); /* CTRL-R <char> */
if (i == Ctrl_O)
i = Ctrl_R; /* CTRL-R CTRL-O == CTRL-R CTRL-R */
if (i == Ctrl_R)
- c = safe_vgetc(); /* CTRL-R CTRL-R <char> */
+ c = plain_vgetc(); /* CTRL-R CTRL-R <char> */
--no_mapping;
#ifdef FEAT_EVAL
/*
diff --git a/src/getchar.c b/src/getchar.c
index f77ddc2a8..4d6da38dd 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -1597,12 +1597,13 @@ vgetc()
}
#endif
#ifdef FEAT_GUI
- /* The caller doesn't need to know that the focus event is delayed
- * until getting a character. */
+ /* Handle focus event here, so that the caller doesn't need to
+ * know about it. Return K_IGNORE so that we loop once (needed if
+ * 'lazyredraw' is set). */
if (c == K_FOCUSGAINED || c == K_FOCUSLOST)
{
ui_focus_change(c == K_FOCUSGAINED);
- continue;
+ c = K_IGNORE;
}
/* Translate K_CSI to CSI. The special key is only used to avoid
@@ -1748,6 +1749,22 @@ safe_vgetc()
}
/*
+ * Like safe_vgetc(), but loop to handle K_IGNORE.
+ * Also ignore scrollbar events.
+ */
+ int
+plain_vgetc()
+{
+ int c;
+
+ do
+ {
+ c = safe_vgetc();
+ } while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR);
+ return c;
+}
+
+/*
* Check if a character is available, such that vgetc() will not block.
* If the next character is a special character or multi-byte, the returned
* character is not valid!.
diff --git a/src/normal.c b/src/normal.c
index 65f7773f8..fbc430a9f 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -696,7 +696,7 @@ getcount:
++allow_keys; /* no mapping for nchar, but keys */
}
++no_zero_mapping; /* don't map zero here */
- c = safe_vgetc();
+ c = plain_vgetc();
#ifdef FEAT_LANGMAP
LANGMAP_ADJUST(c, TRUE);
#endif
@@ -721,7 +721,7 @@ getcount:
ca.count0 = 0;
++no_mapping;
++allow_keys; /* no mapping for nchar, but keys */
- c = safe_vgetc(); /* get next character */
+ c = plain_vgetc(); /* get next character */
#ifdef FEAT_LANGMAP
LANGMAP_ADJUST(c, TRUE);
#endif
@@ -900,7 +900,7 @@ getcount:
* For 'g' get the next character now, so that we can check for
* "gr", "g'" and "g`".
*/
- ca.nchar = safe_vgetc();
+ ca.nchar = plain_vgetc();
#ifdef FEAT_LANGMAP
LANGMAP_ADJUST(ca.nchar, TRUE);
#endif
@@ -957,7 +957,7 @@ getcount:
im_set_active(TRUE);
#endif
- *cp = safe_vgetc();
+ *cp = plain_vgetc();
if (langmap_active)
{
@@ -1045,7 +1045,7 @@ getcount:
}
if (c > 0)
{
- c = safe_vgetc();
+ c = plain_vgetc();
if (c != Ctrl_N && c != Ctrl_G)
vungetc(c);
else
@@ -1064,7 +1064,7 @@ getcount:
while (enc_utf8 && lang && (c = vpeekc()) > 0
&& (c >= 0x100 || MB_BYTE2LEN(vpeekc()) > 1))
{
- c = safe_vgetc();
+ c = plain_vgetc();
if (!utf_iscomposing(c))
{
vungetc(c); /* it wasn't, put it back */
@@ -4564,7 +4564,7 @@ nv_zet(cap)
#endif
++no_mapping;
++allow_keys; /* no mapping for nchar, but allow key codes */
- nchar = safe_vgetc();
+ nchar = plain_vgetc();
#ifdef FEAT_LANGMAP
LANGMAP_ADJUST(nchar, TRUE);
#endif
@@ -4922,7 +4922,7 @@ dozet:
case 'u': /* "zug" and "zuw": undo "zg" and "zw" */
++no_mapping;
++allow_keys; /* no mapping for nchar, but allow key codes */
- nchar = safe_vgetc();
+ nchar = plain_vgetc();
#ifdef FEAT_LANGMAP
LANGMAP_ADJUST(nchar, TRUE);
#endif
diff --git a/src/proto/getchar.pro b/src/proto/getchar.pro
index cc033a3ec..06081c321 100644
--- a/src/proto/getchar.pro
+++ b/src/proto/getchar.pro
@@ -38,6 +38,7 @@ void before_blocking __ARGS((void));
void updatescript __ARGS((int c));
int vgetc __ARGS((void));
int safe_vgetc __ARGS((void));
+int plain_vgetc __ARGS((void));
int vpeekc __ARGS((void));
int vpeekc_nomap __ARGS((void));
int vpeekc_any __ARGS((void));
diff --git a/src/version.c b/src/version.c
index bb8be8d2c..b43dcc761 100644
--- a/src/version.c
+++ b/src/version.c
@@ -667,6 +667,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 104,
+/**/
103,
/**/
102,
diff --git a/src/window.c b/src/window.c
index b94fc34a5..62a39d567 100644
--- a/src/window.c
+++ b/src/window.c
@@ -584,7 +584,7 @@ wingotofile:
++no_mapping;
++allow_keys; /* no mapping for xchar, but allow key codes */
if (xchar == NUL)
- xchar = safe_vgetc();
+ xchar = plain_vgetc();
#ifdef FEAT_LANGMAP
LANGMAP_ADJUST(xchar, TRUE);
#endif