Anonymous avatar Anonymous committed 95d1b07 Draft

ropemacs: added LispUtils.delete()

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):
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.