Skip to content

Commit 36e4193

Browse files
committed
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.
1 parent fdfe754 commit 36e4193

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

meld/filediff.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,14 +1667,12 @@ def on_file_save_button_clicked(self, button):
16671667
self.save_file(idx)
16681668

16691669
def on_fileentry_file_set(self, entry):
1670-
entries = self.fileentry[:self.num_panes]
1670+
pane = self.fileentry[:self.num_panes].index(entry)
16711671
if self.check_save_modified() != Gtk.ResponseType.CANCEL:
1672-
gfiles = [e.get_file() for e in entries]
1673-
# TODO: Make sure to reuse file encodings if present
1674-
self.set_files(gfiles)
1672+
# TODO: Use encoding file selectors in FileDiff
1673+
self.set_file(pane, entry.get_file())
16751674
else:
1676-
idx = entries.index(entry)
1677-
existing_path = self.textbuffer[idx].data.filename
1675+
existing_path = self.textbuffer[pane].data.filename
16781676
entry.set_filename(existing_path)
16791677
return True
16801678

0 commit comments

Comments
 (0)