forked from aniani/vim
updated for version 7.2-021
This commit is contained in:
parent
806875ddb5
commit
f6dad43c98
@ -9542,6 +9542,15 @@ eval_vars(src, srcstart, usedlen, lnump, errormsg, escaped)
|
|||||||
#ifdef FEAT_AUTOCMD
|
#ifdef FEAT_AUTOCMD
|
||||||
case SPEC_AFILE: /* file name for autocommand */
|
case SPEC_AFILE: /* file name for autocommand */
|
||||||
result = autocmd_fname;
|
result = autocmd_fname;
|
||||||
|
if (result != NULL && !autocmd_fname_full)
|
||||||
|
{
|
||||||
|
/* Still need to turn the fname into a full path. It is
|
||||||
|
* postponed to avoid a delay when <afile> is not used. */
|
||||||
|
autocmd_fname_full = TRUE;
|
||||||
|
result = FullName_save(autocmd_fname, FALSE);
|
||||||
|
vim_free(autocmd_fname);
|
||||||
|
autocmd_fname = result;
|
||||||
|
}
|
||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
{
|
{
|
||||||
*errormsg = (char_u *)_("E495: no autocommand file name to substitute for \"<afile>\"");
|
*errormsg = (char_u *)_("E495: no autocommand file name to substitute for \"<afile>\"");
|
||||||
|
10
src/fileio.c
10
src/fileio.c
@ -8523,6 +8523,7 @@ apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
|
|||||||
char_u *save_sourcing_name;
|
char_u *save_sourcing_name;
|
||||||
linenr_T save_sourcing_lnum;
|
linenr_T save_sourcing_lnum;
|
||||||
char_u *save_autocmd_fname;
|
char_u *save_autocmd_fname;
|
||||||
|
int save_autocmd_fname_full;
|
||||||
int save_autocmd_bufnr;
|
int save_autocmd_bufnr;
|
||||||
char_u *save_autocmd_match;
|
char_u *save_autocmd_match;
|
||||||
int save_autocmd_busy;
|
int save_autocmd_busy;
|
||||||
@ -8601,6 +8602,7 @@ apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
|
|||||||
* Save the autocmd_* variables and info about the current buffer.
|
* Save the autocmd_* variables and info about the current buffer.
|
||||||
*/
|
*/
|
||||||
save_autocmd_fname = autocmd_fname;
|
save_autocmd_fname = autocmd_fname;
|
||||||
|
save_autocmd_fname_full = autocmd_fname_full;
|
||||||
save_autocmd_bufnr = autocmd_bufnr;
|
save_autocmd_bufnr = autocmd_bufnr;
|
||||||
save_autocmd_match = autocmd_match;
|
save_autocmd_match = autocmd_match;
|
||||||
save_autocmd_busy = autocmd_busy;
|
save_autocmd_busy = autocmd_busy;
|
||||||
@ -8618,14 +8620,15 @@ apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
|
|||||||
if (fname != NULL && *fname != NUL)
|
if (fname != NULL && *fname != NUL)
|
||||||
autocmd_fname = fname;
|
autocmd_fname = fname;
|
||||||
else if (buf != NULL)
|
else if (buf != NULL)
|
||||||
autocmd_fname = buf->b_fname;
|
autocmd_fname = buf->b_ffname;
|
||||||
else
|
else
|
||||||
autocmd_fname = NULL;
|
autocmd_fname = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
autocmd_fname = fname_io;
|
autocmd_fname = fname_io;
|
||||||
if (autocmd_fname != NULL)
|
if (autocmd_fname != NULL)
|
||||||
autocmd_fname = FullName_save(autocmd_fname, FALSE);
|
autocmd_fname = vim_strsave(autocmd_fname);
|
||||||
|
autocmd_fname_full = FALSE; /* call FullName_save() later */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the buffer number to be used for <abuf>.
|
* Set the buffer number to be used for <abuf>.
|
||||||
@ -8810,6 +8813,7 @@ apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
|
|||||||
sourcing_lnum = save_sourcing_lnum;
|
sourcing_lnum = save_sourcing_lnum;
|
||||||
vim_free(autocmd_fname);
|
vim_free(autocmd_fname);
|
||||||
autocmd_fname = save_autocmd_fname;
|
autocmd_fname = save_autocmd_fname;
|
||||||
|
autocmd_fname_full = save_autocmd_fname_full;
|
||||||
autocmd_bufnr = save_autocmd_bufnr;
|
autocmd_bufnr = save_autocmd_bufnr;
|
||||||
autocmd_match = save_autocmd_match;
|
autocmd_match = save_autocmd_match;
|
||||||
#ifdef FEAT_EVAL
|
#ifdef FEAT_EVAL
|
||||||
@ -8918,7 +8922,7 @@ auto_next_pat(apc, stop_at_last)
|
|||||||
{
|
{
|
||||||
apc->curpat = NULL;
|
apc->curpat = NULL;
|
||||||
|
|
||||||
/* only use a pattern when it has not been removed, has commands and
|
/* Only use a pattern when it has not been removed, has commands and
|
||||||
* the group matches. For buffer-local autocommands only check the
|
* the group matches. For buffer-local autocommands only check the
|
||||||
* buffer number. */
|
* buffer number. */
|
||||||
if (ap->pat != NULL && ap->cmds != NULL
|
if (ap->pat != NULL && ap->cmds != NULL
|
||||||
|
@ -1022,6 +1022,7 @@ EXTERN char_u *new_last_cmdline INIT(= NULL); /* new value for last_cmdline */
|
|||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_AUTOCMD
|
#ifdef FEAT_AUTOCMD
|
||||||
EXTERN char_u *autocmd_fname INIT(= NULL); /* fname for <afile> on cmdline */
|
EXTERN char_u *autocmd_fname INIT(= NULL); /* fname for <afile> on cmdline */
|
||||||
|
EXTERN int autocmd_fname_full; /* autocmd_fname is full path */
|
||||||
EXTERN int autocmd_bufnr INIT(= 0); /* fnum for <abuf> on cmdline */
|
EXTERN int autocmd_bufnr INIT(= 0); /* fnum for <abuf> on cmdline */
|
||||||
EXTERN char_u *autocmd_match INIT(= NULL); /* name for <amatch> on cmdline */
|
EXTERN char_u *autocmd_match INIT(= NULL); /* name for <amatch> on cmdline */
|
||||||
EXTERN int did_cursorhold INIT(= FALSE); /* set when CursorHold t'gerd */
|
EXTERN int did_cursorhold INIT(= FALSE); /* set when CursorHold t'gerd */
|
||||||
|
@ -676,6 +676,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
21,
|
||||||
/**/
|
/**/
|
||||||
20,
|
20,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user