Commit 36e41939 authored by Kai Willadsen's avatar Kai Willadsen

filediff: Update fileentry handling to use new single-pane API

This makes everything a bit better and will maintain currently-set
file encodings, but we still need to use the encoding selector in
FileDiff if we want to handle opening new files with predetermined
encodings from there.
parent fdfe7544
......@@ -1667,14 +1667,12 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
self.save_file(idx)
def on_fileentry_file_set(self, entry):
entries = self.fileentry[:self.num_panes]
pane = self.fileentry[:self.num_panes].index(entry)
if self.check_save_modified() != Gtk.ResponseType.CANCEL:
gfiles = [e.get_file() for e in entries]
# TODO: Make sure to reuse file encodings if present
self.set_files(gfiles)
# TODO: Use encoding file selectors in FileDiff
self.set_file(pane, entry.get_file())
else:
idx = entries.index(entry)
existing_path = self.textbuffer[idx].data.filename
existing_path = self.textbuffer[pane].data.filename
entry.set_filename(existing_path)
return True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment