Beispiel #1
0
def load_modules(obj, loaded):
    """
    Load bracket plugin modules
    """

    plib = obj.get("plugin_library")
    if plib is None:
        return

    try:
        module = ImportModule.import_module(plib, loaded)
        obj["compare"] = getattr(module, "compare", None)
        obj["post_match"] = getattr(module, "post_match", None)
        loaded.add(plib)
    except:
        bh_logging("Could not load module %s\n%s" % (plib, str(traceback.format_exc())))
        raise
Beispiel #2
0
def load_modules(obj, loaded):
    """
    Load bracket plugin modules
    """

    plib = obj.get("plugin_library")
    if plib is None:
        return

    try:
        module = ImportModule.import_module(plib, loaded)
        obj["compare"] = getattr(module, "compare", None)
        obj["post_match"] = getattr(module, "post_match", None)
        loaded.add(plib)
    except:
        bh_logging("Could not load module %s\n%s" % (plib, str(traceback.format_exc())))
        raise
import sublime
from BracketHighlighter.bh_plugin import ImportModule as ImpMod
BracketRemove = ImpMod.import_from("bh_modules.bracketremove", "BracketRemove")


class SwapBrackets(BracketRemove):
    def run(self, edit, name, remove_content=False, remove_indent=False, remove_block=False):
        offset = self.left.toregion().size()
        self.selection = [sublime.Region(self.left.begin, self.right.begin - offset)]
        super(SwapBrackets, self).run(edit, name)


def plugin():
    return SwapBrackets
Beispiel #4
0
import sublime
from BracketHighlighter.bh_plugin import ImportModule as ImpMod

BracketRemove = ImpMod.import_from("bh_modules.bracketremove", "BracketRemove")


class SwapBrackets(BracketRemove):
    def run(self,
            edit,
            name,
            remove_content=False,
            remove_indent=False,
            remove_block=False):
        offset = self.left.toregion().size()
        self.selection = [
            sublime.Region(self.left.begin, self.right.begin - offset)
        ]
        super(SwapBrackets, self).run(edit, name)


def plugin():
    return SwapBrackets