本文整理匯總了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)