fix(autocmd.c): fix conditions in block_autocmds, unblock_autocmds #15372

Logic got swapped in 7574918dc7.
We didn't notice it since v:termresponse isn't really used yet. #6279
This commit is contained in:
gmntroll
2021-08-16 12:43:21 +05:00
committed by GitHub
parent e9dd640897
commit 29712aef60

View File

@ -1724,7 +1724,7 @@ BYPASS_AU:
void block_autocmds(void) void block_autocmds(void)
{ {
// Remember the value of v:termresponse. // Remember the value of v:termresponse.
if (is_autocmd_blocked()) { if (!is_autocmd_blocked()) {
old_termresponse = get_vim_var_str(VV_TERMRESPONSE); old_termresponse = get_vim_var_str(VV_TERMRESPONSE);
} }
autocmd_blocked++; autocmd_blocked++;
@ -1737,7 +1737,7 @@ void unblock_autocmds(void)
// When v:termresponse was set while autocommands were blocked, trigger // When v:termresponse was set while autocommands were blocked, trigger
// the autocommands now. Esp. useful when executing a shell command // the autocommands now. Esp. useful when executing a shell command
// during startup (nvim -d). // during startup (nvim -d).
if (is_autocmd_blocked() if (!is_autocmd_blocked()
&& get_vim_var_str(VV_TERMRESPONSE) != old_termresponse) { && get_vim_var_str(VV_TERMRESPONSE) != old_termresponse) {
apply_autocmds(EVENT_TERMRESPONSE, NULL, NULL, false, curbuf); apply_autocmds(EVENT_TERMRESPONSE, NULL, NULL, false, curbuf);
} }