EMSG(_("E785: complete() can only be used in Insert mode"));
return;
}
+
+ /* Check for undo allowed here, because if something was already inserted
+ * the line was already saved for undo and this check isn't done. */
+ if (!undo_allowed())
+ return;
+
if (argvars[1].v_type != VAR_LIST || argvars[1].vval.v_list == NULL)
{
EMSG(_(e_invarg));
extern int u_savesub __ARGS((linenr_T lnum));
extern int u_inssub __ARGS((linenr_T lnum));
extern int u_savedel __ARGS((linenr_T lnum, long nlines));
+extern int undo_allowed __ARGS((void));
extern void u_undo __ARGS((int count));
extern void u_redo __ARGS((int count));
extern void undo_time __ARGS((long step, int sec, int absolute));
static void u_unch_branch __ARGS((u_header_T *uhp));
static u_entry_T *u_get_headentry __ARGS((void));
static void u_getbot __ARGS((void));
-static int undo_allowed __ARGS((void));
static int u_savecommon __ARGS((linenr_T, linenr_T, linenr_T));
static void u_doit __ARGS((int count));
static void u_undoredo __ARGS((int undo));
* Return TRUE when undo is allowed. Otherwise give an error message and
* return FALSE.
*/
- static int
+ int
undo_allowed()
{
/* Don't allow changes when 'modifiable' is off. */
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 38,
/**/
37,
/**/