[meld] filediff: Check output file override when calculating parent path



commit d8318de3124ba94477d2d7321cb8e1e074c31aa8
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Jan 8 13:05:04 2022 +1000

    filediff: Check output file override when calculating parent path
    
    If we don't use the output file override, we'll try to change the parent
    path from `/` (because the file that's loaded will be in `/tmp`) and
    we'll hit a very reasonable error case in the path label display. This
    change means that we'll instead use the path that we're going to save
    our file to when doing parent calculations.

 meld/filediff.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 7850300a..38420618 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -1443,7 +1443,9 @@ class FileDiff(Gtk.VBox, MeldDoc):
                 'document-save-symbolic' if buf.data.writable else
                 'document-save-as-symbolic')
 
-        parent_path = find_shared_parent_path([b.data.gfile for b in buffers])
+        parent_path = find_shared_parent_path(
+            [b.data.gfiletarget for b in buffers]
+        )
         for pathlabel in self.filelabel:
             pathlabel.props.parent_gfile = parent_path
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]