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
This commit is contained in:
Kovid Goyal 2018-08-04 17:30:45 +05:30
parent 4189aa8f14
commit 9a1f14d05c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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():