mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 16:08:36 +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:
@@ -1802,13 +1802,11 @@ void f_setbufvar(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||
|
||||
// Set curbuf to be our buf, temporarily.
|
||||
aucmd_prepbuf(&aco, buf);
|
||||
if (curbuf == buf) {
|
||||
// Only when it worked to set "curbuf".
|
||||
set_option_from_tv(varname + 1, varp);
|
||||
|
||||
// reset notion of buffer
|
||||
aucmd_restbuf(&aco);
|
||||
}
|
||||
set_option_from_tv(varname + 1, varp);
|
||||
|
||||
// reset notion of buffer
|
||||
aucmd_restbuf(&aco);
|
||||
} else {
|
||||
const size_t varname_len = strlen(varname);
|
||||
char *const bufvarname = xmalloc(varname_len + 3);
|
||||
|
Reference in New Issue
Block a user