本文整理汇总了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)]},
)
示例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()
示例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')
示例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")