dabo Commit
Revision 6184
Date: 2010-11-09 12:44:19 -0800 (Tue, 09 Nov 2010)
Author: Nate
Trac: http://trac.dabodev.com/changeset/6184

Changed:
U   trunk/dabo/ui/uiwx/dEditor.py

Log:
I added a parameter to the _clearDocument method of the dEditor object that 
specifies whether or not to clear the undo buffer.  

I got really annoyed because saving a file would clear the undo filter.  If I 
made a change, saved the file, tested the change and it didn't work, I would 
want to sometimes undo the change.  That couldn't happen if the undo buffer was 
cleared on save.  So, we specifically don't clear the undo buffer on save, but 
still clear it everywhere else.

Diff:
Modified: trunk/dabo/ui/uiwx/dEditor.py
===================================================================
--- trunk/dabo/ui/uiwx/dEditor.py       2010-11-06 16:57:07 UTC (rev 6183)
+++ trunk/dabo/ui/uiwx/dEditor.py       2010-11-09 20:44:19 UTC (rev 6184)
@@ -1458,7 +1458,7 @@
                # set self._fileName, in case it was changed with a Save As
                self._fileName = fname
                self._fileModTime = os.stat(fname).st_mtime
-               self._clearDocument(clearText=False)
+               self._clearDocument(clearText=False, clearUndoBuffer=False)
                # Save the appearance settings
                app = self.Application
                app.setUserSetting("editor.fontsize", self._fontSize)
@@ -1523,12 +1523,13 @@
                return ret
 
 
-       def _clearDocument(self, clearText=True):
+       def _clearDocument(self, clearText=True, clearUndoBuffer=True):
                """Do everything needed to start the doc as if new."""
                if clearText:
                        self.SetText("")
                self.SetSavePoint()
-               self.EmptyUndoBuffer()
+               if clearUndoBuffer:
+                       self.EmptyUndoBuffer()
                self.setTitle()
                self.setDocumentDefaults()
 



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to