diff options
| author | Senthil Kumaran <orsenthil@gmail.com> | 2009-11-23 19:02:52 +0000 | 
|---|---|---|
| committer | Senthil Kumaran <orsenthil@gmail.com> | 2009-11-23 19:02:52 +0000 | 
| commit | 758025cb1fc44c8cfe899744af80b2f5fa87be89 (patch) | |
| tree | dc5c4a3b96b2daac3c91b5f902be1fe793ee106a /Lib/difflib.py | |
| parent | 71db3cd63d2ec714da0773b5538bfadd7414cee2 (diff) | |
| download | cpython-git-758025cb1fc44c8cfe899744af80b2f5fa87be89.tar.gz | |
Merged revisions 76464 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
  r76464 | senthil.kumaran | 2009-11-24 00:11:31 +0530 (Tue, 24 Nov 2009) | 4 lines
  Fix for issue1488943 - difflib.Differ() doesn't always add hints for tab
  characters.
........
Diffstat (limited to 'Lib/difflib.py')
| -rw-r--r-- | Lib/difflib.py | 9 | 
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/difflib.py b/Lib/difflib.py index 052a627e21..264860e2a3 100644 --- a/Lib/difflib.py +++ b/Lib/difflib.py @@ -1060,20 +1060,21 @@ class Differ:          Example:          >>> d = Differ() -        >>> results = d._qformat('\tabcDefghiJkl\n', '\t\tabcdefGhijkl\n', -        ...                      '  ^ ^  ^      ', '+  ^ ^  ^      ') +        >>> results = d._qformat('\tabcDefghiJkl\n', '\tabcdefGhijkl\n', +        ...                      '  ^ ^  ^      ', '  ^ ^  ^      ')          >>> for line in results: print(repr(line))          ...          '- \tabcDefghiJkl\n'          '? \t ^ ^  ^\n' -        '+ \t\tabcdefGhijkl\n' -        '? \t  ^ ^  ^\n' +        '+ \tabcdefGhijkl\n' +        '? \t ^ ^  ^\n'          """          # Can hurt, but will probably help most of the time.          common = min(_count_leading(aline, "\t"),                       _count_leading(bline, "\t"))          common = min(common, _count_leading(atags[:common], " ")) +        common = min(common, _count_leading(btags[:common], " "))          atags = atags[common:].rstrip()          btags = btags[common:].rstrip()  | 
