當前位置: 首頁>>代碼示例>>Python>>正文


Python View.run_command方法代碼示例

本文整理匯總了Python中sublime.View.run_command方法的典型用法代碼示例。如果您正苦於以下問題:Python View.run_command方法的具體用法?Python View.run_command怎麽用?Python View.run_command使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sublime.View的用法示例。


在下文中一共展示了View.run_command方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: try_jump_to_def_aux

# 需要導入模塊: from sublime import View [as 別名]
# 或者: from sublime.View import run_command [as 別名]
def try_jump_to_def_aux(view: sublime.View, name: str) -> None:
    start_time = time.time()
    while view.is_loading():
        time.sleep(0.01)
        if time.time() - start_time > 1:
            return
    symbols = {strip_prefix(text): pos for (pos, text) in view.symbols()}
    if name in symbols:
        region = symbols[name]
        view.run_command(
            "simple_context_show_selection",
            {"regions": [(region.a, region.b)]},
        )
開發者ID:equiva1ence,項目名稱:ConTeXtTools,代碼行數:15,代碼來源:completions.py

示例2: on_modified

# 需要導入模塊: from sublime import View [as 別名]
# 或者: from sublime.View import run_command [as 別名]
    def on_modified(self, view: sublime.View) -> None:
        """Called after changes has been made to a view.
        """

        if not is_python(view, autocomplete_ignore_repl=True):
            return

        global JUST_COMPLETED

        if (view.substr(view.sel()[0].begin() - 1) == '('
                and view.substr(view.sel()[0].begin()) == ')'):
            if JUST_COMPLETED:
                view.run_command('anaconda_complete_funcargs')

            JUST_COMPLETED = False
        elif view.substr(sublime.Region(
                view.sel()[0].begin() - 7, view.sel()[0].end())) == 'import ':
            self._run_auto_complete()
開發者ID:lpig,項目名稱:sublime-backup,代碼行數:20,代碼來源:completion.py

示例3: start_view

# 需要導入模塊: from sublime import View [as 別名]
# 或者: from sublime.View import run_command [as 別名]
def start_view(view: sublime.View):
    view.run_command('code_intel_start_client')
開發者ID:Kronuz,項目名稱:SublimeCodeIntel,代碼行數:4,代碼來源:configuration.py

示例4: on_phantom_navigate

# 需要導入模塊: from sublime import View [as 別名]
# 或者: from sublime.View import run_command [as 別名]
def on_phantom_navigate(view: sublime.View, href: str, point: int):
    # TODO: don't mess with the user's cursor.
    sel = view.sel()
    sel.clear()
    sel.add(sublime.Region(point))
    view.run_command("code_intel_code_actions")
開發者ID:Kronuz,項目名稱:SublimeCodeIntel,代碼行數:8,代碼來源:diagnostics.py


注:本文中的sublime.View.run_command方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。