diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-07-12 19:49:41 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-07-12 19:49:41 +0000 |
commit | ce6ef25cef1fb542b3d9bd6a52a55b6418934e6d (patch) | |
tree | 39d5ab6f7e2e24110997acc51f4d16699ddbca96 | |
parent | a3f2ecdecb2854f1c0da13dc80435ddf7df2c57c (diff) |
updated for version 7.0-038v7.0.038
-rw-r--r-- | src/eval.c | 6 | ||||
-rw-r--r-- | src/proto/undo.pro | 1 | ||||
-rw-r--r-- | src/undo.c | 3 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 10 insertions, 2 deletions
diff --git a/src/eval.c b/src/eval.c index 273ac41360..01610fe3bb 100644 --- a/src/eval.c +++ b/src/eval.c @@ -8252,6 +8252,12 @@ f_complete(argvars, rettv) 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)); diff --git a/src/proto/undo.pro b/src/proto/undo.pro index c48e65cb2d..1397dc5a38 100644 --- a/src/proto/undo.pro +++ b/src/proto/undo.pro @@ -4,6 +4,7 @@ extern int u_save __ARGS((linenr_T top, linenr_T bot)); 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)); diff --git a/src/undo.c b/src/undo.c index fd1bcc79c4..6a9864104e 100644 --- a/src/undo.c +++ b/src/undo.c @@ -84,7 +84,6 @@ 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)); @@ -196,7 +195,7 @@ u_savedel(lnum, nlines) * 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. */ diff --git a/src/version.c b/src/version.c index 8c03ce877c..bee5a39731 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 */ /**/ + 38, +/**/ 37, /**/ 36, |