mirror of
https://github.com/beetbox/beets.git
synced 2025-12-16 05:34:47 +01:00
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.
This commit is contained in:
parent
5ce996df0d
commit
c1ebae83bc
1 changed files with 2 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue