meld r1336 - trunk



Author: vincele
Date: Sat Apr 11 22:35:30 2009
New Revision: 1336
URL: http://svn.gnome.org/viewvc/meld?rev=1336&view=rev

Log:
Rework supply_newline handling.
Less code, as easy to understand as old one, looks simpler.

The ordering change in the conditional should be harmless.


Modified:
   trunk/filediff.py

Modified: trunk/filediff.py
==============================================================================
--- trunk/filediff.py	(original)
+++ trunk/filediff.py	Sat Apr 11 22:35:30 2009
@@ -570,12 +570,10 @@
                         if hasattr(t.file, "newlines"):
                             self.bufferdata[t.pane].newlines = t.file.newlines
                         tasks.remove(t)
+                        if (self.prefs.supply_newline and t.text and not t.text[-1].endswith("\n")):
+                            t.buf.insert(t.buf.get_end_iter(), "\n")
+                            t.text.append("\n")
                         panetext[t.pane] = "".join(t.text)
-                        if len(panetext[t.pane]) and \
-                            panetext[t.pane][-1] != "\n" and \
-                            self.prefs.supply_newline:
-                                t.buf.insert( t.buf.get_end_iter(), "\n")
-                                panetext[t.pane] += "\n"
             yield 1
         self.undosequence.clear()
         yield _("[%s] Computing differences") % self.label_text



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