mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 00:08:19 +00:00
refactor: eliminate autocmd_fname_full
global
It's a micro-optimization; check path_is_absolute_path(autocmd_fname) instead. The main optimization (which is still in place) afforded by Vim 7.2.021 was to avoid resolving <afile> when it is not needed.
This commit is contained in:
@@ -8546,11 +8546,10 @@ eval_vars (
|
||||
resultbuf = result; /* remember allocated string */
|
||||
break;
|
||||
|
||||
case SPEC_AFILE: /* file name for autocommand */
|
||||
if (autocmd_fname != NULL && !autocmd_fname_full) {
|
||||
case SPEC_AFILE: // file name for autocommand
|
||||
if (autocmd_fname != NULL && !path_is_absolute_path(autocmd_fname)) {
|
||||
// Still need to turn the fname into a full path. It was
|
||||
// postponed to avoid a delay when <afile> is not used.
|
||||
autocmd_fname_full = true;
|
||||
result = (char_u *)FullName_save((char *)autocmd_fname, false);
|
||||
// Copy into `autocmd_fname`, don't reassign it. #8165
|
||||
xstrlcpy((char *)autocmd_fname, (char *)result, MAXPATHL);
|
||||
|
Reference in New Issue
Block a user