diff kitten: Render tabs as four spaces instead of <9>

This commit is contained in:
Kovid Goyal 2018-05-20 15:29:12 +05:30
parent b1b90d2bf7
commit 912b395316
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -152,10 +152,13 @@ def data_for_path(path):
@lru_cache(maxsize=1024) @lru_cache(maxsize=1024)
def lines_for_path(path): def lines_for_path(path):
data = data_for_path(path) data = data_for_path(path).replace('\t', lines_for_path.replace_tab_by)
return tuple(sanitize(data).splitlines()) return tuple(sanitize(data).splitlines())
lines_for_path.replace_tab_by = ' ' * 4
@lru_cache(maxsize=1024) @lru_cache(maxsize=1024)
def hash_for_path(path): def hash_for_path(path):
return md5(raw_data_for_path(path)).digest() return md5(raw_data_for_path(path)).digest()