From c1ebae83bc44fb35e599813a30868e88c76a2d16 Mon Sep 17 00:00:00 2001 From: Tai Lee Date: Thu, 6 Jun 2013 10:44:24 +1000 Subject: [PATCH] Decouple `color_diff()` UI function from `string_dist()` matcher function. These are separate issues. We're still colorising case changes in light gray because these characters are effectively equivalent, but symbol and transliteration edits will continue to be colorised in red. --- beets/ui/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index 21d56ad0d..460320a34 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -37,7 +37,6 @@ from beets.util.functemplate import Template from beets import config from beets.util import confit from beets.autotag import mb -from beets.autotag.match import string_dist # On Windows platforms, use colorama to support "ANSI" terminal colors. @@ -404,8 +403,8 @@ def _colordiff(a, b, highlight='red', second_highlight='lightgray'): a_out.append(colorize(highlight, a[a_start:a_end])) elif op == 'replace': # Right and left differ. Colorise with second highlight if - # there's no distance penalty. - if string_dist(a[a_start:a_end], b[b_start:b_end]): + # it's just a case change. + if a[a_start:a_end].lower() != b[b_start:b_end].lower(): color = highlight else: color = second_highlight