sistemata funzione copy all and refresh, aggiunta icona

This commit is contained in:
VALLONGOL 2025-12-23 14:55:53 +01:00
parent cf1db0db60
commit 3720d3c755
2 changed files with 8 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 0 B

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -554,9 +554,15 @@ class DiffViewer(tk.Toplevel):
dst_text = self.left_text if dst == 'left' else self.right_text
if not messagebox.askyesno('Confirm copy all', f'Copy entire content from {src} to {dst}?', parent=self):
return
content = src_text.get('1.0', 'end')
# use end-1c to avoid the Text widget's extra trailing newline
content = src_text.get('1.0', 'end-1c')
dst_text.delete('1.0', 'end')
# if content is empty, ensure destination becomes empty (no extra newline)
if content:
dst_text.insert('1.0', content)
else:
# keep widget empty
pass
self._mark_dirty(dst)
self._refresh_diff()