Anonymous avatar Anonymous committed b11d2ec

Clearing undo when editor.set_text is called

Comments (0)

Files changed (6)

+- Enhancing editor and indentation
+    - Pressing backspace should deindent
+
+
 - Showing current line in status bar : April 28, 2006
 
 
 
 * Enhancing editor and indentation @ 1
   * Clearing undo list when opening a file; undoSeparator when saving
-  * Pressing back space should deindent; shortcuts for indenting and deindenting
   * Showing modified file status
 
 

docs/workingon.txt

-* Pressing back space should deindent; shortcuts for indenting and deindenting
+* Clearing undo list when opening a file; undoSeparator when saving
 
-* Indenter.deindent
-^ Rename Indenter.indent_line to Indenter.correct_indentation
+- Calling editor.undo_separator in fileeditor.save
+- Clearing undo when editor.set_text is called
 
 ? Adding EditorManager class
 ? Adding selection list class
     def search(self, keyword, start, case=True, forwards=True):
         pass
 
+    def undo_separator(self):
+        pass
 
 class TextIndex(object):
     '''A class for pointing to a position in a text'''
         self.text.insert('1.0', text)
         self.text.mark_set(INSERT, '1.0')
         self._highlight_range('0.0', 'end')
+        self.text.edit_reset()
 
     def get_start(self):
         return GraphicalTextIndex(self, '1.0')
     def getWidget(self):
         return self.text
 
-    def undoSeparator(self):
+    def undo_separator(self):
         self.text.edit_separator()
 
     def undo(self):

rope/fileeditor.py

 
     def save(self):
         self.file.write(self.editor.get_text())
+        self.editor.undo_separator()
 
     def get_editor(self):
         return self.editor

ropetest/editortest.py

         unittest.TestCase.tearDown(self)
 
     def test_undo(self):
-        self.editor.undoSeparator()
+        self.editor.undo_separator()
         self.editor.insert(self.editor.get_end(), '.')
         self.assertEquals('sample text.', self.editor.get_text())
         self.editor.undo()
         self.assertEquals('sample text', self.editor.get_text(),self.editor.get_text())
 
     def test_redo(self):
-        self.editor.undoSeparator()
+        self.editor.undo_separator()
         self.editor.insert(self.editor.get_end(), '.')
         self.editor.undo()
         self.editor.redo()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.