Пример #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())
Пример #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)
Пример #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
        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)
Пример #4
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())
Пример #5
0
 def smart_down(region):
     target = region_f(regions, region.end()) or first(regions)
     return target.begin()