++no_mapping;
++allow_keys;
- c = safe_vgetc();
+ c = plain_vgetc();
--no_mapping;
--allow_keys;
if (c != ESC) /* ESC cancels CTRL-K */
#endif
++no_mapping;
++allow_keys;
- cc = safe_vgetc();
+ cc = plain_vgetc();
--no_mapping;
--allow_keys;
if (cc != ESC) /* ESC cancels CTRL-K */
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");
}
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)
#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;
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
* deleted when ESC is hit.
*/
++no_mapping;
- regname = safe_vgetc();
+ regname = plain_vgetc();
#ifdef FEAT_LANGMAP
LANGMAP_ADJUST(regname, TRUE);
#endif
#ifdef FEAT_CMDL_INFO
add_to_showcmd_c(literally);
#endif
- regname = safe_vgetc();
+ regname = plain_vgetc();
#ifdef FEAT_LANGMAP
LANGMAP_ADJUST(regname, TRUE);
#endif
* deleted when ESC is hit.
*/
++no_mapping;
- c = safe_vgetc();
+ c = plain_vgetc();
--no_mapping;
switch (c)
{
* 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 */
}
++no_mapping;
++allow_keys;
- cc = safe_vgetc();
+ cc = plain_vgetc();
--no_mapping;
--allow_keys;
if (cc != ESC)
*
* 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_"
#endif
++no_mapping; /* don't map this key */
++allow_keys; /* allow special keys */
- i = safe_vgetc();
+ i = plain_vgetc();
--allow_keys;
--no_mapping;
{
++no_mapping;
++allow_keys;
- c = safe_vgetc();
+ c = plain_vgetc();
--no_mapping;
--allow_keys;
/* CTRL-\ e doesn't work when obtaining an expression. */
#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
/*
}
#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
return c;
}
+/*
+ * 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
++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
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
* 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
im_set_active(TRUE);
#endif
- *cp = safe_vgetc();
+ *cp = plain_vgetc();
if (langmap_active)
{
}
if (c > 0)
{
- c = safe_vgetc();
+ c = plain_vgetc();
if (c != Ctrl_N && c != Ctrl_G)
vungetc(c);
else
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 */
#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
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
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));
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 104,
/**/
103,
/**/
++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