mirror of
https://github.com/neovim/neovim.git
synced 2025-11-09 12:05:14 +00:00
feat(aucmd_win): allow crazy things with hidden buffers (#21250)
Problem: Crash when doing crazy things with hidden buffers. Solution: Dynamically allocate the list of autocommand windows.
This commit is contained in:
@@ -86,8 +86,6 @@ static void find_win_for_curbuf(void)
|
||||
///
|
||||
/// Information is saved in "cob" and MUST be restored by calling
|
||||
/// change_other_buffer_restore().
|
||||
///
|
||||
/// If this fails then "curbuf" will not be equal to "buf".
|
||||
static void change_other_buffer_prepare(cob_T *cob, buf_T *buf)
|
||||
{
|
||||
CLEAR_POINTER(cob);
|
||||
@@ -105,9 +103,7 @@ static void change_other_buffer_prepare(cob_T *cob, buf_T *buf)
|
||||
// curwin->w_buffer differ from "curbuf", use the autocmd window.
|
||||
curbuf = curwin->w_buffer;
|
||||
aucmd_prepbuf(&cob->cob_aco, buf);
|
||||
if (curbuf == buf) {
|
||||
cob->cob_using_aco = true;
|
||||
}
|
||||
cob->cob_using_aco = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user