[meld] filediff: Handle initial loads for missing gfiles
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] filediff: Handle initial loads for missing gfiles
- Date: Sat, 9 Dec 2017 21:54:14 +0000 (UTC)
commit bab6479de8e79f24171a26d2e055af3ff686c81e
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Dec 10 07:43:04 2017 +1000
filediff: Handle initial loads for missing gfiles
This can happen if e.g., the user selects one file in the new comparison
UI but leaves the other blank. Without the buffer-is-loaded logic
addition here, the UI just stalls in a loading state.
meld/filediff.py | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 50e6407..2615c1f 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -1057,11 +1057,12 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
encodings = encodings or ((None,) * len(gfiles))
- files = [
- (pane, gfile, encoding)
- for pane, (gfile, encoding) in enumerate(zip(gfiles, encodings))
- if gfile
- ]
+ files = []
+ for pane, (gfile, encoding) in enumerate(zip(gfiles, encodings)):
+ if gfile:
+ files.append((pane, gfile, encoding))
+ else:
+ self.textbuffer[pane].data.loaded = True
if not files:
self.scheduler.add_task(self._compare_files_internal())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]