patch 8.0.0641: cannot set a separate highlighting for the quickfix line
Problem: Cannot set a separate highlighting for the current line in the
quickfix window.
Solution: Add QuickFixLine. (anishsane, closes #1755)
diff --git a/src/option.c b/src/option.c
index f9d2734..2a92bc5 100644
--- a/src/option.c
+++ b/src/option.c
@@ -476,8 +476,9 @@
/* Make the string as short as possible when compiling with few features. */
#if defined(FEAT_DIFF) || defined(FEAT_FOLDING) || defined(FEAT_SPELL) \
|| defined(FEAT_WINDOWS) || defined(FEAT_CLIPBOARD) \
- || defined(FEAT_INS_EXPAND) || defined(FEAT_SYN_HL) || defined(FEAT_CONCEAL)
-# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn"
+ || defined(FEAT_INS_EXPAND) || defined(FEAT_SYN_HL) \
+ || defined(FEAT_CONCEAL) || defined(FEAT_QUICKFIX)
+# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine"
#else
# define HIGHLIGHT_INIT "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,t:Title,v:Visual,w:WarningMsg,W:WildMenu,>:SignColumn,*:TabLine,#:TabLineSel,_:TabLineFill"
#endif
diff --git a/src/quickfix.c b/src/quickfix.c
index 8b61e10..61e96dd 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -2575,7 +2575,7 @@
vim_snprintf((char *)IObuff, IOSIZE, "%2d %s",
i, (char *)fname);
msg_outtrans_attr(IObuff, i == qi->qf_lists[qi->qf_curlist].qf_index
- ? HL_ATTR(HLF_L) : HL_ATTR(HLF_D));
+ ? HL_ATTR(HLF_QFL) : HL_ATTR(HLF_D));
if (qfp->qf_lnum == 0)
IObuff[0] = NUL;
else if (qfp->qf_col == 0)
diff --git a/src/screen.c b/src/screen.c
index 325d9ae..f10f70d 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -3371,7 +3371,7 @@
# if defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)
/* Highlight the current line in the quickfix window. */
if (bt_quickfix(wp->w_buffer) && qf_current_entry(wp) == lnum)
- line_attr = HL_ATTR(HLF_L);
+ line_attr = HL_ATTR(HLF_QFL);
# endif
if (line_attr != 0)
area_highlighting = TRUE;
diff --git a/src/syntax.c b/src/syntax.c
index 225853e..56d69c6 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -6970,6 +6970,8 @@
#ifdef FEAT_GUI
"Normal gui=NONE",
#endif
+ CENT("QuickFixLine term=reverse ctermbg=Cyan",
+ "QuickFixLine term=reverse ctermbg=Cyan guibg=Cyan"),
NULL
};
@@ -7055,6 +7057,8 @@
CENT("Conceal ctermbg=DarkGrey ctermfg=LightGrey",
"Conceal ctermbg=DarkGrey ctermfg=LightGrey guibg=DarkGrey guifg=LightGrey"),
#endif
+ CENT("QuickFixLine term=reverse ctermbg=Cyan",
+ "QuickFixLine term=reverse ctermbg=Cyan guibg=Cyan"),
#ifdef FEAT_GUI
"Normal gui=NONE",
#endif
diff --git a/src/version.c b/src/version.c
index 5d935fe..365dbc5 100644
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 641,
+/**/
640,
/**/
639,
diff --git a/src/vim.h b/src/vim.h
index caf89d4..243f8a2 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -1433,6 +1433,7 @@
, HLF_CUC /* 'cursurcolumn' */
, HLF_CUL /* 'cursurline' */
, HLF_MC /* 'colorcolumn' */
+ , HLF_QFL /* quickfix window line currently selected */
, HLF_COUNT /* MUST be the last one */
} hlf_T;
@@ -1442,7 +1443,7 @@
'n', 'N', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
'f', 'F', 'A', 'C', 'D', 'T', '-', '>', \
'B', 'P', 'R', 'L', \
- '+', '=', 'x', 'X', '*', '#', '_', '!', '.', 'o'}
+ '+', '=', 'x', 'X', '*', '#', '_', '!', '.', 'o', 'q'}
/*
* Boolean constants