Commits

Anonymous committed 50b696c

ropemacs: added LispUtils.delete()

  • Participants
  • Parent commits fd21f1b

Comments (0)

Files changed (2)

ropecommon/interface.py

     def _apply_assist(self, assist):
         if ' : ' in assist:
             name, module = assist.rsplit(' : ', 1)
-            lisp.delete_region(self.starting_offset + 1, self.offset + 1)
+            self.env.delete(self.starting_offset + 1, self.offset + 1)
             self.env.insert(name)
             self._insert_import(name, module)
         else:
-            lisp.delete_region(self.starting_offset + 1, self.offset + 1)
+            self.env.delete(self.starting_offset + 1, self.offset + 1)
             self.env.insert(assist)
 
     def _calculate_proposals(self):
     def insert(self, text):
         lisp.insert(text)
 
+    def delete(self, start, end):
+        lisp.delete_region(start, end)
+
     def filenames(self):
         result = []
         for buffer in lisp.buffer_list():
     def find_file(self, filename, readonly=False, other=False):
         if other:
             lisp.find_file_other_window(filename)
-        elif not readonly:
+        elif readonly:
+            lisp.find_file_read_only(filename)
+        else:
             lisp.find_file(filename)
-        else:
-            lisp.find_file_read_only(filename)
 
     def make_buffer(self, name, contents, empty_goto=True, switch=False,
                     window='other', modes=[], fit_lines=None):