grep: add color.grep.matchcontext and color.grep.matchselected
The config option color.grep.match can be used to specify the highlighting color for matching strings. Add the options matchContext and matchSelected to allow different colors to be specified for matching strings in the context vs. in selected lines. This is similar to the ms and mc specifiers in GNU grep's environment variable GREP_COLORS. Tests are from Zoltan Klinger's earlier attempt to solve the same issue in a different way. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
eeff891ac7
commit
79a77109d3
3
grep.h
3
grep.h
@ -124,7 +124,8 @@ struct grep_opt {
|
||||
char color_filename[COLOR_MAXLEN];
|
||||
char color_function[COLOR_MAXLEN];
|
||||
char color_lineno[COLOR_MAXLEN];
|
||||
char color_match[COLOR_MAXLEN];
|
||||
char color_match_context[COLOR_MAXLEN];
|
||||
char color_match_selected[COLOR_MAXLEN];
|
||||
char color_selected[COLOR_MAXLEN];
|
||||
char color_sep[COLOR_MAXLEN];
|
||||
int regflags;
|
||||
|
Reference in New Issue
Block a user