From 912b395316b26d0752a6cdda21feb3d3eea33d7a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 20 May 2018 15:29:12 +0530 Subject: [PATCH] diff kitten: Render tabs as four spaces instead of <9> --- kittens/diff/collect.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kittens/diff/collect.py b/kittens/diff/collect.py index 9b9fc5986..8bbb2037e 100644 --- a/kittens/diff/collect.py +++ b/kittens/diff/collect.py @@ -152,10 +152,13 @@ def data_for_path(path): @lru_cache(maxsize=1024) 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()) +lines_for_path.replace_tab_by = ' ' * 4 + + @lru_cache(maxsize=1024) def hash_for_path(path): return md5(raw_data_for_path(path)).digest()