revert: "refactor: eliminate autocmd_fname_full global"

This reverts commit 82cd0be2ea.
This commit is contained in:
zeertzjq
2023-06-07 09:26:46 +08:00
parent 0e0a166a0c
commit 971049f318
5 changed files with 12 additions and 4 deletions

View File

@@ -1603,6 +1603,7 @@ bool apply_autocmds_group(event_T event, char *fname, char *fname_io, bool force
// Save the autocmd_* variables and info about the current buffer.
char *save_autocmd_fname = autocmd_fname;
bool save_autocmd_fname_full = autocmd_fname_full;
int save_autocmd_bufnr = autocmd_bufnr;
char *save_autocmd_match = autocmd_match;
int save_autocmd_busy = autocmd_busy;
@@ -1631,6 +1632,7 @@ bool apply_autocmds_group(event_T event, char *fname, char *fname_io, bool force
// Allocate MAXPATHL for when eval_vars() resolves the fullpath.
autocmd_fname = xstrnsave(autocmd_fname, MAXPATHL);
}
autocmd_fname_full = false; // call FullName_save() later
// Set the buffer number to be used for <abuf>.
autocmd_bufnr = buf == NULL ? 0 : buf->b_fnum;
@@ -1806,6 +1808,7 @@ bool apply_autocmds_group(event_T event, char *fname, char *fname_io, bool force
estack_pop();
xfree(autocmd_fname);
autocmd_fname = save_autocmd_fname;
autocmd_fname_full = save_autocmd_fname_full;
autocmd_bufnr = save_autocmd_bufnr;
autocmd_match = save_autocmd_match;
current_sctx = save_current_sctx;