Beispiel #1
0
    def run(self, edit):
        pos = cursor_pos(self.view)
        region = word_at(self.view, pos)
        if not region:
            return
        word = self.view.substr(region)

        all_regions = self.view.find_all(r'\b%s\b' % word)
        next_region = region_f(all_regions, region.end()) or first(all_regions)

        set_cursor(self.view, next_region.begin())
Beispiel #2
0
    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)
Beispiel #3
0
    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)
    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)
    def run(self, edit):
        pos = cursor_pos(self.view)
        region = word_at(self.view, pos)
        if not region:
            return
        word = self.view.substr(region)

        all_regions = self.view.find_all(r'\b%s\b' % word)
        next_region = region_b(all_regions, region.begin() - 1) or last(all_regions)

        set_cursor(self.view, next_region.begin())
    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)
Beispiel #7
0
 def run(self, edit):
     pos = cursor_pos(self.view)
     this_block = block_at(self.view, pos)
     self.view.erase(edit, expand_min_gap(self.view, this_block))
 def run(self, edit):
    pos = cursor_pos(self.view)
    this_block = block_at(self.view, pos)
    self.view.erase(edit, expand_min_gap(self.view, this_block))