def run(self, edit): blocks = list_blocks(self.view) this_block = region_at(blocks, cursor_pos(self.view)) if not this_block: return next_block = region_f(blocks, this_block.end()) if not next_block: return swap_regions(self.view, edit, this_block, next_block) self.view.show(next_block)
def run(self, edit): blocks = list_blocks(self.view) this_block = region_at(blocks, cursor_pos(self.view)) if not this_block: return prev_block = region_b(blocks, this_block.begin() - 1) if not prev_block: return swap_regions(self.view, edit, prev_block, this_block) self.view.show(prev_block)