mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -04:00
patch 8.2.4028: ml_get error with :doautoall and Visual area
Problem: ml_get error with :doautoall and Visual area. (Sean Dewar) Solution: Disable Visual mode while executing autocommands.
This commit is contained in:
@@ -1424,8 +1424,6 @@ ex_doautoall(exarg_T *eap)
|
||||
if (call_do_modelines && did_aucmd)
|
||||
do_modelines(0);
|
||||
}
|
||||
|
||||
check_cursor(); // just in case lines got deleted
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1532,6 +1530,10 @@ aucmd_prepbuf(
|
||||
curbuf = buf;
|
||||
aco->new_curwin_id = curwin->w_id;
|
||||
set_bufref(&aco->new_curbuf, curbuf);
|
||||
|
||||
// disable the Visual area, the position may be invalid in another buffer
|
||||
aco->save_VIsual_active = VIsual_active;
|
||||
VIsual_active = FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1656,6 +1658,11 @@ win_found:
|
||||
check_cursor();
|
||||
}
|
||||
}
|
||||
|
||||
check_cursor(); // just in case lines got deleted
|
||||
VIsual_active = aco->save_VIsual_active;
|
||||
if (VIsual_active)
|
||||
check_pos(curbuf, &VIsual);
|
||||
}
|
||||
|
||||
static int autocmd_nested = FALSE;
|
||||
|
Reference in New Issue
Block a user