Пример #1
0
def plugin_loaded():
    """
    Load up uniocode table, initialize settings and match object,
    and start event loop.  Restart event loop if already loaded.
    """

    BhEventMgr.load()
    init_bh_match()
    ure.set_cache_directory(join(sublime.packages_path(), "User"), "bh")

    global HIGH_VISIBILITY
    if sublime.load_settings("bh_core.sublime-settings").get('high_visibility_enabled_by_default', False):
        HIGH_VISIBILITY = True

    if 'running_bh_loop' not in globals():
        global running_bh_loop
        running_bh_loop = True
        thread.start_new_thread(bh_loop, ())
        debug("Starting Thread")
    else:
        debug("Restarting Thread")
        BhThreadMgr.restart = True
Пример #2
0
def plugin_loaded():
    """
    Load up uniocode table, initialize settings and match object,
    and start event loop.  Restart event loop if already loaded.
    """

    BhEventMgr.load()
    init_bh_match()
    ure.set_cache_directory(join(sublime.packages_path(), "User"), "bh")

    global HIGH_VISIBILITY
    if sublime.load_settings("bh_core.sublime-settings").get(
            'high_visibility_enabled_by_default', False):
        HIGH_VISIBILITY = True

    if 'running_bh_loop' not in globals():
        global running_bh_loop
        running_bh_loop = True
        thread.start_new_thread(bh_loop, ())
        debug("Starting Thread")
    else:
        debug("Restarting Thread")
        BhThreadMgr.restart = True
Пример #3
0
from os.path import basename, exists, join, normpath
import sublime
import sublime_plugin
from time import time, sleep
import thread
import ure
from bh_plugin import BracketPlugin, BracketRegion, ImportModule
from collections import namedtuple
import traceback

ure.set_cache_directory(join(sublime.packages_path(), "User"), "bh")

BH_MATCH_TYPE_NONE = 0
BH_MATCH_TYPE_SELECTION = 1
BH_MATCH_TYPE_EDIT = 2
DEFAULT_STYLES = {
    "default": {"icon": "dot", "color": "brackethighlighter.default", "style": "underline"},
    "unmatched": {"icon": "question", "color": "brackethighlighter.unmatched", "style": "outline"},
}
HV_RSVD_VALUES = ["__default__", "__bracket__"]

HIGH_VISIBILITY = False

GLOBAL_ENABLE = True


def bh_logging(msg):
    print("BracketHighlighter: %s" % msg)


def bh_debug(msg):