def run(self, edit, before): loc = op.sel_cursor_location(self.view, require_fully_selected=True) run_command_thru_palette( self.view.window(), 'poli_move', { 'dest_module': op.view_module_name(self.view), 'anchor': loc.entry.name(), 'before': before })
def run(self, edit): loc = op.sel_cursor_location(self.view, require_fully_selected=True) run_command_thru_palette( self.view.window(), 'poli_move', { 'src_module_entry': [op.view_module_name(self.view), loc.entry.name()], })
def run(self, edit): loc = op.sel_cursor_location(self.view) if not loc.is_def_targeted: sublime.status_message("Cursor is not placed over definition") return op.enter_edit_mode(self.view, loc.entry.reg_def, adding_new=False) if loc.is_fully_selected: set_selection(self.view, to=loc.entry.reg_def)
def run(self, edit): reg = single_selected_region(self.view) if op.reg_import_section(self.view).contains(reg): raise NotImplementedError # TODO: implement import rename self.view.run_command('poli_rename_this_import') return loc = op.sel_cursor_location(self.view) if not loc.is_name_targeted: sublime.status_message("Cursor is not placed over entry name") return op.enter_edit_mode(self.view, loc.entry.reg_name, adding_new=False)
def run(self, edit, before): def insert_dummy_def(at): reg = insert_in(self.view, edit, at, "name ::= definition") self.view.insert(edit, reg.end(), "\n") set_selection(self.view, to=reg, show=True) return reg # In case the module is absolutely empty, take a different approach if op.reg_body(self.view).empty(): self.view.set_read_only(False) reg_new = insert_dummy_def(at=self.view.size()) else: loc = op.sel_cursor_location(self.view) entry_name = loc.entry.name() self.view.set_read_only(False) reg_new = insert_dummy_def( at=loc.entry.reg_nl.begin() if before else loc.entry.reg_nl.end() ) op.enter_edit_mode(self.view, reg_new, adding_new=True)
def run(self, edit): loc = op.sel_cursor_location(self.view) set_selection(self.view, to=loc.entry.reg)