From 13e148687c4eb60205c56b0ddaf19241daea7ca4 Mon Sep 17 00:00:00 2001 From: Florian Walch Date: Tue, 28 Apr 2015 12:02:48 +0300 Subject: vim-patch:7.4.630 #2524 Problem: When using Insert mode completion combined with autocommands the redo command may not work. Solution: Do not save the redo buffer when executing autocommands. (Yasuhiro Matsumoto) https://github.com/vim/vim/commit/v7-4-630 --- src/nvim/fileio.c | 10 ++++++++-- src/nvim/version.c | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 0dcf43c659..44bed92133 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -6466,6 +6466,7 @@ apply_autocmds_group ( long save_cmdbang; static int filechangeshell_busy = FALSE; proftime_T wait_time; + bool did_save_redobuff = false; /* * Quickly return if there are no autocommands for this event or @@ -6641,7 +6642,10 @@ apply_autocmds_group ( */ if (!autocmd_busy) { save_search_patterns(); - saveRedobuff(); + if (!ins_compl_active()) { + saveRedobuff(); + did_save_redobuff = true; + } did_filetype = keep_filetype; } @@ -6726,7 +6730,9 @@ apply_autocmds_group ( // free any windows in the au_pending_free_win list. if (!autocmd_busy) { restore_search_patterns(); - restoreRedobuff(); + if (did_save_redobuff) { + restoreRedobuff(); + } did_filetype = FALSE; while (au_pending_free_buf != NULL) { buf_T *b = au_pending_free_buf->b_next; diff --git a/src/nvim/version.c b/src/nvim/version.c index a6a86f09d1..1d0804796e 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -149,7 +149,7 @@ static int included_patches[] = { //633, //632, //631, - //630, + 630, //629, //628, //627, -- cgit