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


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怎麽用?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
            ) 
開發者ID:sublimelsp,項目名稱:LSP,代碼行數:26,代碼來源:references.py

示例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) 
開發者ID:garveen,項目名稱:docphp,代碼行數:18,代碼來源:docphp.py

示例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") 
開發者ID:sublimelsp,項目名稱:LSP,代碼行數:28,代碼來源:goto.py

示例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") 
開發者ID:sublimelsp,項目名稱:LSP,代碼行數:14,代碼來源:symbols.py

示例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!") 
開發者ID:pichillilorenzo,項目名稱:JavaScriptEnhancements,代碼行數:31,代碼來源:add_flow_definition.py


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