Ensure highlighting is run only once

This commit is contained in:
Kovid Goyal 2018-05-08 09:20:36 +05:30
parent 09a3a3dafb
commit 7b1626a38f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -49,6 +49,7 @@ def __init__(self, args, opts, left, right):
self.report_traceback_on_exit = None
self.args = args
self.scroll_pos = self.max_scroll_pos = 0
self.highlighting_done = False
def create_collection(self):
self.start_job('collect', create_collection, self.left, self.right)
@ -186,7 +187,8 @@ def on_job_done(self, job_id, job_result):
self.diff_map = diff_map
self.render_diff()
self.draw_screen()
if initialize_highlighter is not None:
if initialize_highlighter is not None and not self.highlighting_done:
self.highlighting_done = True
initialize_highlighter()
self.start_job('highlight', highlight_collection, self.collection)
elif job_id == 'highlight':