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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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