*/
static mapblock_T *first_abbr = NULL; /* first entry in abbrlist */
-static int KeyNoremap = FALSE; /* remapping disabled */
+static int KeyNoremap = 0; /* remapping flags */
/*
* variables used by vgetorpeek() and flush_buffers()
/*
* Put character "c" back into the typeahead buffer.
* Can be used for a character obtained by vgetc() that needs to be put back.
+ * Uses cmd_silent, KeyTyped and KeyNoremap to restore the flags belonging to
+ * the char.
*/
void
ins_char_typebuf(c)
buf[1] = NUL;
#endif
}
- (void)ins_typebuf(buf, REMAP_YES, 0, !KeyTyped, FALSE);
+ (void)ins_typebuf(buf, KeyNoremap, 0, !KeyTyped, cmd_silent);
}
/*
gotchars(typebuf.tb_buf
+ typebuf.tb_off, 1);
}
- KeyNoremap = (typebuf.tb_noremap[
- typebuf.tb_off]
- & (RM_NONE|RM_SCRIPT));
+ KeyNoremap = typebuf.tb_noremap[
+ typebuf.tb_off];
del_typebuf(1, 0);
}
break; /* got character, break for loop */
if (typebuf.tb_no_abbr_cnt) /* abbrev. are not recursive */
return FALSE;
- if (KeyNoremap) /* no remapping implies no abbreviation */
+ if ((KeyNoremap & (RM_NONE|RM_SCRIPT)) != 0)
+ /* no remapping implies no abbreviation */
return FALSE;
/*
/* Fake a "c"hange command. When "restart_edit" is set (e.g., because
* 'insertmode' is set) fake a "d"elete command, Insert mode will
* restart automatically.
- * Insert the typed character in the typeahead buffer, so that it will
- * be mapped in Insert mode. Required for ":lmap" to work. May cause
- * mapping a character from ":vnoremap"... */
+ * Insert the typed character in the typeahead buffer, so that it can
+ * be mapped in Insert mode. Required for ":lmap" to work. */
ins_char_typebuf(c);
if (restart_edit != 0)
c = 'd';