From 9a1f14d05c12681f0c0b6a155f939b3690e95a2e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 4 Aug 2018 17:30:45 +0530 Subject: [PATCH] diff kitten: Do not highlight extremely large files python's asyncio module has no way to tell a process executor object to kill its worker processes, so highlighting very large files cause the kitten to hang around o exit till the highlighting is done --- kittens/diff/highlight.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kittens/diff/highlight.py b/kittens/diff/highlight.py index da7650cde..c159ff7e9 100644 --- a/kittens/diff/highlight.py +++ b/kittens/diff/highlight.py @@ -122,6 +122,8 @@ def highlight_line(line): def highlight_for_diff(path, aliases): ans = [] lines = lines_for_path(path) + if len(lines) > 10000: + return ans hd = highlight_data('\n'.join(lines), path, aliases) if hd is not None: for line in hd.splitlines():