Skip to content

Commit cc7d08e

Browse files
committed
updated for version 7.4.109
Problem: ColorScheme autocommand matches with the current buffer name. Solution: Match with the colorscheme name. (Christian Brabandt)
1 parent 52376de commit cc7d08e

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

runtime/doc/autocmd.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,12 @@ CmdwinLeave Before leaving the command-line window.
480480
|cmdwin-char|
481481
*ColorScheme*
482482
ColorScheme After loading a color scheme. |:colorscheme|
483+
The pattern is matched against the
484+
colorscheme name. <afile> can be used for the
485+
name of the actual file where this option was
486+
set, and <amatch> for the new colorscheme
487+
name.
488+
483489

484490
*CompleteDone*
485491
CompleteDone After Insert mode completion is done. Either

src/fileio.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9330,7 +9330,9 @@ apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
93309330
*/
93319331
if (fname_io == NULL)
93329332
{
9333-
if (fname != NULL && *fname != NUL)
9333+
if (event == EVENT_COLORSCHEME)
9334+
autocmd_fname = NULL;
9335+
else if (fname != NULL && *fname != NUL)
93349336
autocmd_fname = fname;
93359337
else if (buf != NULL)
93369338
autocmd_fname = buf->b_ffname;
@@ -9383,14 +9385,15 @@ apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
93839385
else
93849386
{
93859387
sfname = vim_strsave(fname);
9386-
/* Don't try expanding FileType, Syntax, FuncUndefined, WindowID or
9387-
* QuickFixCmd* */
9388+
/* Don't try expanding FileType, Syntax, FuncUndefined, WindowID,
9389+
* ColorScheme or QuickFixCmd* */
93889390
if (event == EVENT_FILETYPE
93899391
|| event == EVENT_SYNTAX
93909392
|| event == EVENT_FUNCUNDEFINED
93919393
|| event == EVENT_REMOTEREPLY
93929394
|| event == EVENT_SPELLFILEMISSING
93939395
|| event == EVENT_QUICKFIXCMDPRE
9396+
|| event == EVENT_COLORSCHEME
93949397
|| event == EVENT_QUICKFIXCMDPOST)
93959398
fname = vim_strsave(fname);
93969399
else

src/syntax.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7071,7 +7071,7 @@ load_colors(name)
70717071
retval = source_runtime(buf, FALSE);
70727072
vim_free(buf);
70737073
#ifdef FEAT_AUTOCMD
7074-
apply_autocmds(EVENT_COLORSCHEME, NULL, NULL, FALSE, curbuf);
7074+
apply_autocmds(EVENT_COLORSCHEME, name, curbuf->b_fname, FALSE, curbuf);
70757075
#endif
70767076
}
70777077
recursive = FALSE;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ static char *(features[]) =
738738

739739
static int included_patches[] =
740740
{ /* Add new patch number below this line */
741+
/**/
742+
109,
741743
/**/
742744
108,
743745
/**/

0 commit comments

Comments
 (0)