mirror of
https://github.com/vim/vim.git
synced 2025-07-24 10:45:12 -04:00
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)
This commit is contained in:
parent
f1a4c98ea6
commit
e7d1376b63
@ -568,7 +568,11 @@ pum_set_selected(n, repeat)
|
|||||||
if (p_pvh > 0 && p_pvh < g_do_tagpreview)
|
if (p_pvh > 0 && p_pvh < g_do_tagpreview)
|
||||||
g_do_tagpreview = p_pvh;
|
g_do_tagpreview = p_pvh;
|
||||||
++RedrawingDisabled;
|
++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);
|
resized = prepare_tagpreview(FALSE);
|
||||||
|
--no_u_sync;
|
||||||
--RedrawingDisabled;
|
--RedrawingDisabled;
|
||||||
g_do_tagpreview = 0;
|
g_do_tagpreview = 0;
|
||||||
|
|
||||||
@ -659,7 +663,9 @@ pum_set_selected(n, repeat)
|
|||||||
* redraw. */
|
* redraw. */
|
||||||
if (resized)
|
if (resized)
|
||||||
{
|
{
|
||||||
|
++no_u_sync;
|
||||||
win_enter(curwin_save, TRUE);
|
win_enter(curwin_save, TRUE);
|
||||||
|
--no_u_sync;
|
||||||
update_topline();
|
update_topline();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -670,7 +676,11 @@ pum_set_selected(n, repeat)
|
|||||||
pum_do_redraw = FALSE;
|
pum_do_redraw = FALSE;
|
||||||
|
|
||||||
if (!resized && win_valid(curwin_save))
|
if (!resized && win_valid(curwin_save))
|
||||||
|
{
|
||||||
|
++no_u_sync;
|
||||||
win_enter(curwin_save, TRUE);
|
win_enter(curwin_save, TRUE);
|
||||||
|
--no_u_sync;
|
||||||
|
}
|
||||||
|
|
||||||
/* May need to update the screen again when there are
|
/* May need to update the screen again when there are
|
||||||
* autocommands involved. */
|
* autocommands involved. */
|
||||||
|
@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
901,
|
||||||
/**/
|
/**/
|
||||||
900,
|
900,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user