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)