mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-10-26 23:24:58 +03:00
Ensure highlighting is run only once
This commit is contained in:
parent
09a3a3dafb
commit
7b1626a38f
@ -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':
|
||||
|
Loading…
Reference in New Issue
Block a user