diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-10-26 14:22:13 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-10-26 14:22:13 +0900 |
commit | d1f96fd84d362a31dd8a26ae18c10539e07cd600 (patch) | |
tree | 4468c1375eef2995a8cb683693c971e5f8ae22d4 | |
parent | Merge branch 'du/get-tar-commit-id-is-plumbing' (diff) | |
parent | diff.c: pass sign_index to emit_line_ws_markup (diff) | |
download | tgif-d1f96fd84d362a31dd8a26ae18c10539e07cd600.tar.xz |
Merge branch 'sb/diff-emit-line-ws-markup-cleanup'
Code clean-up.
* sb/diff-emit-line-ws-markup-cleanup:
diff.c: pass sign_index to emit_line_ws_markup
-rw-r--r-- | diff.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -1217,10 +1217,11 @@ static void dim_moved_lines(struct diff_options *o) static void emit_line_ws_markup(struct diff_options *o, const char *set_sign, const char *set, const char *reset, - char sign, const char *line, int len, + int sign_index, const char *line, int len, unsigned ws_rule, int blank_at_eof) { const char *ws = NULL; + int sign = o->output_indicators[sign_index]; if (o->ws_error_highlight & ws_rule) { ws = diff_get_color_opt(o, DIFF_WHITESPACE); @@ -1300,8 +1301,7 @@ static void emit_diff_symbol_from_struct(struct diff_options *o, set = diff_get_color_opt(o, DIFF_FILE_OLD); } emit_line_ws_markup(o, set_sign, set, reset, - o->output_indicators[OUTPUT_INDICATOR_CONTEXT], - line, len, + OUTPUT_INDICATOR_CONTEXT, line, len, flags & (DIFF_SYMBOL_CONTENT_WS_MASK), 0); break; case DIFF_SYMBOL_PLUS: @@ -1345,8 +1345,7 @@ static void emit_diff_symbol_from_struct(struct diff_options *o, flags &= ~DIFF_SYMBOL_CONTENT_WS_MASK; } emit_line_ws_markup(o, set_sign, set, reset, - o->output_indicators[OUTPUT_INDICATOR_NEW], - line, len, + OUTPUT_INDICATOR_NEW, line, len, flags & DIFF_SYMBOL_CONTENT_WS_MASK, flags & DIFF_SYMBOL_CONTENT_BLANK_LINE_EOF); break; @@ -1390,8 +1389,7 @@ static void emit_diff_symbol_from_struct(struct diff_options *o, set = diff_get_color_opt(o, DIFF_CONTEXT_DIM); } emit_line_ws_markup(o, set_sign, set, reset, - o->output_indicators[OUTPUT_INDICATOR_OLD], - line, len, + OUTPUT_INDICATOR_OLD, line, len, flags & DIFF_SYMBOL_CONTENT_WS_MASK, 0); break; case DIFF_SYMBOL_WORDS_PORCELAIN: |