summaryrefslogtreecommitdiff
path: root/src/edit.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-07-04 20:25:41 +0200
committerBram Moolenaar <Bram@vim.org>2013-07-04 20:25:41 +0200
commit3c1e9c2a1f415b5299282ab76b90465a2e064333 (patch)
tree0d49b6d4eb9c06cfb9b1bafb32b02b3235691462 /src/edit.c
parentc84e3c1ee1cc3bc79dc5c313df593670528ac395 (diff)
downloadvim-3c1e9c2a1f415b5299282ab76b90465a2e064333.zip
updated for version 7.3.1303
Problem: Undo is synced whenever CTRL-R = is called, breaking some plugins. Solution: Only break undo when calling setline() or append().
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/edit.c b/src/edit.c
index ee308bd79..b76ebe5c1 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -8135,9 +8135,9 @@ ins_reg()
# ifdef USE_IM_CONTROL
int im_on = im_get_status();
# endif
- /* Sync undo, so the effect of e.g., setline() can be undone. */
- u_sync(TRUE);
- ins_need_undo = TRUE;
+ /* Sync undo when evaluating the expression calls setline() or
+ * append(), so that it can be undone separately. */
+ u_sync_once = 2;
regname = get_expr_register();
# ifdef USE_IM_CONTROL
@@ -8178,6 +8178,9 @@ ins_reg()
#ifdef FEAT_EVAL
}
--no_u_sync;
+ if (u_sync_once == 1)
+ ins_need_undo = TRUE;
+ u_sync_once = 0;
#endif
#ifdef FEAT_CMDL_INFO
clear_showcmd();