Wednesday, September 4, 2013

Re: Set different highlighting for Search versus current quickfix error

On Wed, 4 Sep 2013, Paul wrote:

> It seems to be hard coded. Apparently not easy to circumvent:
> http://stackoverflow.com/questions/13220073/vim-highlight-quickfix-selected-line-with-color-different-than-search
>

In case you are (or anyone else is) interested in changing the source,
the hard-coding happens at line 2007 of src/quickfix.c¹:

2006: msg_outtrans_attr(IObuff, i == qi->qf_lists[qi->qf_curlist].qf_index
2007: ? hl_attr(HLF_L) : hl_attr(HLF_D));

HLF_L is the C constant for the "L"ast search highlighting. So, it's
not hardcoded to "Search", per se, but rather whatever is in the "l:"
key of the 'highlight' setting (default "l:Search"). It is,
unfortunately, linked to actual search highlighting -- i.e. you can't
have different highlight groups for searching and the active quickfix
line.

It's slightly odd that all the other colors in the quickfix window are
overrideable. The following four groups are defined in
$VIMRUNTIME/syntax/qf.vim² (default link listed in parens):

qfFileName (Directory)
qfSeparator (no default)
qfLineNr (LineNr)
qfError (Error)

--
Best,
Ben

¹: https://code.google.com/p/vim/source/browse/src/quickfix.c#2007
²: Based on that file, it's also clear that quickfix highlighting will
fail on a filename containing a pipe (blech).

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: