if (!strcmp(arg, "no"))
return COLOR_MOVED_NO;
+ else if (!strcmp(arg, "plain"))
+ return COLOR_MOVED_PLAIN;
else if (!strcmp(arg, "zebra"))
return COLOR_MOVED_ZEBRA;
else if (!strcmp(arg, "default"))
return COLOR_MOVED_DEFAULT;
else
- return error(_("color moved setting must be one of 'no', 'default', 'zebra'"));
+ return error(_("color moved setting must be one of 'no', 'default', 'zebra', 'plain'"));
}
int git_diff_ui_config(const char *var, const char *value, void *cb)
}
if (!match) {
- if (block_length < COLOR_MOVED_MIN_BLOCK_LENGTH) {
+ if (block_length < COLOR_MOVED_MIN_BLOCK_LENGTH &&
+ o->color_moved != COLOR_MOVED_PLAIN) {
for (i = 0; i < block_length + 1; i++) {
l = &o->emitted_symbols->buf[n - i];
l->flags &= ~DIFF_SYMBOL_MOVED_LINE;
l->flags |= DIFF_SYMBOL_MOVED_LINE;
block_length++;
+ if (o->color_moved == COLOR_MOVED_PLAIN)
+ continue;
+
/* Check any potential block runs, advance each or nullify */
for (i = 0; i < pmb_nr; i++) {
struct moved_entry *p = pmb[i];