Skip to content

Commit bc9feb0

Browse files
stefanbellergitster
authored andcommitted
diff.c: pass sign_index to emit_line_ws_markup
Instead of passing the sign directly to emit_line_ws_markup, pass only the index to lookup the sign in diff_options->output_indicators. Signed-off-by: Stefan Beller <[email protected]> Acked-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5a0cc8a commit bc9feb0

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

diff.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,10 +1202,11 @@ static void dim_moved_lines(struct diff_options *o)
12021202
static void emit_line_ws_markup(struct diff_options *o,
12031203
const char *set_sign, const char *set,
12041204
const char *reset,
1205-
char sign, const char *line, int len,
1205+
int sign_index, const char *line, int len,
12061206
unsigned ws_rule, int blank_at_eof)
12071207
{
12081208
const char *ws = NULL;
1209+
int sign = o->output_indicators[sign_index];
12091210

12101211
if (o->ws_error_highlight & ws_rule) {
12111212
ws = diff_get_color_opt(o, DIFF_WHITESPACE);
@@ -1285,8 +1286,7 @@ static void emit_diff_symbol_from_struct(struct diff_options *o,
12851286
set = diff_get_color_opt(o, DIFF_FILE_OLD);
12861287
}
12871288
emit_line_ws_markup(o, set_sign, set, reset,
1288-
o->output_indicators[OUTPUT_INDICATOR_CONTEXT],
1289-
line, len,
1289+
OUTPUT_INDICATOR_CONTEXT, line, len,
12901290
flags & (DIFF_SYMBOL_CONTENT_WS_MASK), 0);
12911291
break;
12921292
case DIFF_SYMBOL_PLUS:
@@ -1330,8 +1330,7 @@ static void emit_diff_symbol_from_struct(struct diff_options *o,
13301330
flags &= ~DIFF_SYMBOL_CONTENT_WS_MASK;
13311331
}
13321332
emit_line_ws_markup(o, set_sign, set, reset,
1333-
o->output_indicators[OUTPUT_INDICATOR_NEW],
1334-
line, len,
1333+
OUTPUT_INDICATOR_NEW, line, len,
13351334
flags & DIFF_SYMBOL_CONTENT_WS_MASK,
13361335
flags & DIFF_SYMBOL_CONTENT_BLANK_LINE_EOF);
13371336
break;
@@ -1375,8 +1374,7 @@ static void emit_diff_symbol_from_struct(struct diff_options *o,
13751374
set = diff_get_color_opt(o, DIFF_CONTEXT_DIM);
13761375
}
13771376
emit_line_ws_markup(o, set_sign, set, reset,
1378-
o->output_indicators[OUTPUT_INDICATOR_OLD],
1379-
line, len,
1377+
OUTPUT_INDICATOR_OLD, line, len,
13801378
flags & DIFF_SYMBOL_CONTENT_WS_MASK, 0);
13811379
break;
13821380
case DIFF_SYMBOL_WORDS_PORCELAIN:

0 commit comments

Comments
 (0)