diff options
author | watiko <service@mail.watiko.net> | 2016-02-15 22:15:53 +0900 |
---|---|---|
committer | watiko <service@mail.watiko.net> | 2016-02-15 22:28:45 +0900 |
commit | 4a4c3fdfcdc69bb7fc05bd9133eb5a255da84015 (patch) | |
tree | 5784d20d57fab78828a863b95a8a359ebf1ccd83 /src | |
parent | 7609a96a35224be3d7f3ba77691f9115e0281b4e (diff) | |
download | rneovim-4a4c3fdfcdc69bb7fc05bd9133eb5a255da84015.tar.gz rneovim-4a4c3fdfcdc69bb7fc05bd9133eb5a255da84015.tar.bz2 rneovim-4a4c3fdfcdc69bb7fc05bd9133eb5a255da84015.zip |
vim-patch:7.4.901
Problem: When a BufLeave autocommand changes folding in a way it syncs
undo, undo can be corrupted.
Solution: Prevent undo sync. (Jacob Niehus)
https://github.com/vim/vim/commit/e7d1376b636e6c758196c3542bd2c1053f9edb75
---
see: "[bug] [patch] Setting foldmethod in WinLeave autocommand can corrupt undo state"
https://groups.google.com/d/msg/vim_dev/xF5uMLb1vwY/Jn4RglosDgAJ
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/popupmnu.c | 8 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/nvim/popupmnu.c b/src/nvim/popupmnu.c index 001740943f..5ad621e666 100644 --- a/src/nvim/popupmnu.c +++ b/src/nvim/popupmnu.c @@ -545,7 +545,11 @@ static int pum_set_selected(int n, int repeat) g_do_tagpreview = (int)p_pvh; } RedrawingDisabled++; + // Prevent undo sync here, if an autocommand syncs undo weird + // things can happen to the undo tree. + no_u_sync++; resized = prepare_tagpreview(false); + no_u_sync--; RedrawingDisabled--; g_do_tagpreview = 0; @@ -629,7 +633,9 @@ static int pum_set_selected(int n, int repeat) // the window when needed, otherwise it will always be // redraw. if (resized) { + no_u_sync++; win_enter(curwin_save, true); + no_u_sync--; update_topline(); } @@ -640,7 +646,9 @@ static int pum_set_selected(int n, int repeat) pum_do_redraw = FALSE; if (!resized && win_valid(curwin_save)) { + no_u_sync++; win_enter(curwin_save, true); + no_u_sync--; } // May need to update the screen again when there are diff --git a/src/nvim/version.c b/src/nvim/version.c index 4de63ebb10..0c831f9f40 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -387,7 +387,7 @@ static int included_patches[] = { // 904, // 903, // 902 NA - // 901, + 901, // 900 NA // 899 NA 898, |