本文整理汇总了Python中sublime.View.rowcol方法的典型用法代码示例。如果您正苦于以下问题:Python View.rowcol方法的具体用法?Python View.rowcol怎么用?Python View.rowcol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sublime.View
的用法示例。
在下文中一共展示了View.rowcol方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_query_completions
# 需要导入模块: from sublime import View [as 别名]
# 或者: from sublime.View import rowcol [as 别名]
def on_query_completions(self, view: sublime.View, prefix: str, locations: List[Tuple[int]]) -> Tuple[List[Tuple[str]], int]: # noqa
"""Sublime Text autocompletion event handler
"""
if not is_python(view, autocomplete_ignore_repl=True):
return
if completion_is_disabled(view):
return
if not dot_completion(view):
enable_dot_completion(view)
global JUST_COMPLETED
if self.ready_from_defer is True:
completion_flags = 0
if get_settings(view, 'suppress_word_completions', False):
completion_flags = sublime.INHIBIT_WORD_COMPLETIONS
if get_settings(view, 'suppress_explicit_completions', False):
completion_flags |= sublime.INHIBIT_EXPLICIT_COMPLETIONS
cpl = self.completions
self.completions = []
self.ready_from_defer = False
JUST_COMPLETED = True
return (cpl, completion_flags)
location = view.rowcol(locations[0])
data = prepare_send_data(location, 'autocomplete', 'jedi')
Worker().execute(self._complete, **data)
示例2: on_modified
# 需要导入模块: from sublime import View [as 别名]
# 或者: from sublime.View import rowcol [as 别名]
def on_modified(self, view: sublime.View) -> None:
"""Called after changes has been made to a view
"""
if view.command_history(0)[0] in ("expand_tabs", "unexpand_tabs"):
return
if not is_python(view) or not get_settings(view, 'display_signatures'):
return
try:
location = view.rowcol(view.sel()[0].begin())
if view.substr(view.sel()[0].begin()) in ['(', ')']:
location = (location[0], location[1] - 1)
data = prepare_send_data(location, 'doc', 'jedi')
use_tooltips = get_settings(
view, 'enable_signatures_tooltip', True
)
st_version = int(sublime.version())
if st_version >= 3070:
data['html'] = use_tooltips
currying = partial(self.prepare_data_status, view)
if use_tooltips and st_version >= 3070:
currying = partial(self.prepare_data_tooltip, view)
Worker().execute(currying, **data)
except Exception as error:
logging.error(error)