[PATCH] meldbuffer: Set buffer label in reset_buffer()



Retain the original label if it's valid.  If it's not, set the label
equal to the buffer filename.

Without this change the labels in file diffs default to "unnamed"
values.

Signed-off-by: Peter Tyser <ptyser gmail com>
---
This change should revert to the original functionality before the
"meldbuffer: Make the reset_buffer() call not recreate MeldBufferData"
change was applied.

 meld/meldbuffer.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meld/meldbuffer.py b/meld/meldbuffer.py
index b91feab..f1e4dd8 100644
--- a/meld/meldbuffer.py
+++ b/meld/meldbuffer.py
@@ -40,7 +40,7 @@ class MeldBuffer(GtkSource.Buffer):
     def reset_buffer(self, filename):
         """Clear the contents of the buffer and reset its metadata"""
         self.delete(*self.get_bounds())
-        label = self.data.label if self.data.filename == filename else None
+        label = self.data.label if self.data.filename == filename else filename
         self.data.reset()
         self.data.filename = filename
         self.data.label = label
-- 
1.8.3.2




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