本文整理汇总了Python中sublime.KEEP_OPEN_ON_FOCUS_LOST属性的典型用法代码示例。如果您正苦于以下问题:Python sublime.KEEP_OPEN_ON_FOCUS_LOST属性的具体用法?Python sublime.KEEP_OPEN_ON_FOCUS_LOST怎么用?Python sublime.KEEP_OPEN_ON_FOCUS_LOST使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类sublime
的用法示例。
在下文中一共展示了sublime.KEEP_OPEN_ON_FOCUS_LOST属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: show_quick_panel
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import KEEP_OPEN_ON_FOCUS_LOST [as 别名]
def show_quick_panel(self, references_by_file: Dict[str, List[Tuple[Point, str]]]) -> None:
selected_index = -1
current_file_path = self.view.file_name()
self.reflist.clear()
for file_path, references in references_by_file.items():
for reference in references:
point, line = reference
item = ['{}:{}:{}'.format(self.get_relative_path(file_path), point.row + 1, point.col + 1), line]
self.reflist.append(item)
# pre-select a reference in the current file.
if current_file_path == file_path and selected_index == -1:
selected_index = len(self.reflist) - 1
flags = sublime.KEEP_OPEN_ON_FOCUS_LOST
window = self.view.window()
if window:
window.show_quick_panel(
self.reflist,
self.on_ref_choice,
flags,
selected_index,
self.on_ref_highlight
)
示例2: run
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import KEEP_OPEN_ON_FOCUS_LOST [as 别名]
def run(self, edit, languageName=None, set_fallback=False, is_init=False):
view = self.view
global currentView
currentView = view
if self.downloading:
sublime.message_dialog('Another progress is working for checkout ' + self.downloading + '. Please try again later.')
return
self.languageList, index = getLanguageList(languageName)
self.set_fallback = set_fallback
if languageName:
self.updateLanguage(index)
else:
currentView.window().show_quick_panel(self.languageList, self.updateLanguage, sublime.KEEP_OPEN_ON_FOCUS_LOST)
示例3: handle_response
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import KEEP_OPEN_ON_FOCUS_LOST [as 别名]
def handle_response(self, response: Any) -> None:
window = self.view.window()
view = self.view
if window is None:
return
if response:
# Save to jump back history.
get_jump_history_for_view(view).push_selection(view)
# TODO: DocumentLink support.
if isinstance(response, dict):
locations = [location_to_encoded_filename(response)]
else:
locations = process_response_list(response)
if len(locations) == 1:
open_location(window, locations[0])
elif len(locations) > 1:
window.show_quick_panel(
items=locations,
on_select=lambda x: select_entry(window, locations, x, view),
on_highlight=lambda x: highlight_entry(window, locations, x),
flags=sublime.KEEP_OPEN_ON_FOCUS_LOST)
# TODO: can add region here.
else:
sublime.status_message("Empty response from language server, "
"reverting to Sublime's built-in Goto Definition")
window.run_command("goto_definition")
示例4: handle_response
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import KEEP_OPEN_ON_FOCUS_LOST [as 别名]
def handle_response(self, response: Any) -> None:
window = self.view.window()
if window and isinstance(response, list) and len(response) > 0:
self.old_regions = [sublime.Region(r.a, r.b) for r in self.view.sel()]
self.is_first_selection = True
window.show_quick_panel(
self.process_symbols(response),
self.on_symbol_selected,
sublime.KEEP_OPEN_ON_FOCUS_LOST,
0,
self.on_highlighted)
self.view.run_command("lsp_selection_clear")
示例5: search
# 需要导入模块: import sublime [as 别名]
# 或者: from sublime import KEEP_OPEN_ON_FOCUS_LOST [as 别名]
def search(self, package_name):
self.window.status_message("Searching for '" + package_name + "' definitions...")
node = NodeJS(check_local=True)
result = node.execute("flow-typed", command_args=["search", package_name], is_from_bin=True)
if result[0]:
lines = result[1].encode('ascii', errors='ignore').decode("utf-8").strip().split("\n")
linesNotDecoded = result[1].strip().split("\n")
found_definations_flag = False
for i in range(0, len(lines)):
line = lines[i].strip()
lineNotDecoded = linesNotDecoded[i].strip()
if found_definations_flag and line:
item = lineNotDecoded.split(b'\xe2\x94\x82'.decode("utf-8"))
for j in range(0, len(item)):
item[j] = item[j].encode('ascii', errors='ignore').decode("utf-8").strip()
self.flow_typed_searched_items += [[item[0] + " " + item[1], "Flow version supported: " + item[2]]]
elif line.startswith("Name") and line.endswith("Flow Version"):
found_definations_flag = True
if len(self.flow_typed_searched_items) > 0:
self.window.show_quick_panel(self.flow_typed_searched_items, lambda index: sublime.set_timeout_async(lambda: self.install_definition(index)), sublime.KEEP_OPEN_ON_FOCUS_LOST)
else:
self.window.status_message("No definitions found, sorry!")