summaryrefslogtreecommitdiff
path: root/User/flip_selections.py
blob: 1651c44f2125f9402acaf1111946bd8c309fe73d (plain)
1
2
3
4
5
6
7
8
9
import sublime
import sublime_plugin

class FlipSelectionsCommand(sublime_plugin.TextCommand):
    def run(self, edit):
        sel = self.view.sel()
        new_regions = map(lambda r: sublime.Region(r.b, r.a), sel)
        for r in new_regions:
            sel.add(r)