python类TRANSIENT的实例源码

go_to_definition.py 文件源码 项目:FlowIDE 作者: tptee 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def run_async(self):
        result = None
        try:
            result = CLI(self.view).get_def()
        except InvalidContext:
            print('Invalid context')
            pass
        except Exception as e:
            display_unknown_error(self.view, e)
            return

        print(result)
        if not result or not result.get('path'):
            return

        sublime.active_window().open_file(
            result['path'] +
            ':' + str(result['line']) +
            ':' + str(result['start']),
            sublime.ENCODED_POSITION |
            sublime.TRANSIENT
        )
kodidevkit.py 文件源码 项目:KodiDevKit 作者: phil65 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def show_preview(self, index):
        node = self.nodes[index]
        self.window.open_file("%s:%i" % (node["file"], node["line"]),
                              sublime.ENCODED_POSITION | sublime.TRANSIENT)
kodidevkit.py 文件源码 项目:KodiDevKit 作者: phil65 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def show_preview(self, index):
        if index >= 0:
            file_path = self.files[index]
            sublime.active_window().open_file(file_path, sublime.TRANSIENT)
kodidevkit.py 文件源码 项目:KodiDevKit 作者: phil65 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def show_preview(self, index):
        if index >= 0:
            file_path = os.path.join(INFOS.addon.media_path, self.files[index])
        sublime.active_window().open_file(file_path, sublime.TRANSIENT)
input_for_path.py 文件源码 项目:FileManager 作者: math2001 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def open_in_transient(self, index):
        if self.no_browser_action is False and index < 2:
            return
        if not os.path.isfile(os.path.join(self.browser.path, self.browser.items[index])):
            return
        self.window.open_file(os.path.join(self.browser.path, self.browser.items[index]),
                              sublime.TRANSIENT)
core.py 文件源码 项目:SublimeGotoUsage 作者: syko 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def open_usage(view, usage, is_transient = False):
    view = view.window().open_file(usage['path'], is_transient and sublime.TRANSIENT or 0)
    if view.is_loading():
        open_callbacks.append({
            'view': view,
            'callback': lambda view, cb: show_usage(view, usage, is_transient)
        })
    else:
        show_usage(view, usage, is_transient)
explore_panel.py 文件源码 项目:sublimeTextConfig 作者: luoye-fe 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def jump(self, transient: bool=False) -> None:
        """Jump to the selection
        """

        flags = sublime.ENCODED_POSITION
        if transient is True:
            flags |= sublime.TRANSIENT

        get_jump_history_for_view(self.view).push_selection(self.view)
        sublime.active_window().open_file(self.position, flags)
        if not transient:
            self._toggle_indicator()
jediusages.py 文件源码 项目:sublimeTextConfig 作者: luoye-fe 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def _jump(self, filename: Union[int, str], lineno: int =None,
              columno: int =None, transient: bool =False) -> None:
        """Jump to a window
        """

        # process jumps from options window
        if type(filename) is int:
            if filename == -1:
                # restore view
                view = self.text.view
                point = self.point

                sublime.active_window().focus_view(view)
                view.show(point)

                if view.sel()[0] != point:
                    view.sel().clear()
                    view.sel().add(point)

                return

        opts = self.options[filename]
        if len(self.options[filename]) == 4:
            opts = opts[1:]

        filename, lineno, columno = opts
        flags = sublime.ENCODED_POSITION
        if transient:
            flags |= sublime.TRANSIENT

        sublime.active_window().open_file(
            '{}:{}:{}'.format(filename, lineno or 0, columno or 0),
            flags
        )

        self._toggle_indicator(lineno, columno)
dired.py 文件源码 项目:sublime-dired 作者: Twizzledrizzle 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def run(self, view, path):
        window = self.view.window()
        groups = groups_on_preview(window)
        window.focus_group(groups[1])

        # Get directory preview view.
        preview_id = self.view.settings().get('preview_id')
        preview_view = first(window.views(), lambda v: v.id() == preview_id)


        if os.path.isfile(path):
            if preview_view :
                window.focus_view(preview_view)
                window.run_command('close_file')
            window.open_file(path, sublime.TRANSIENT)
            try :
                window.active_view().set_read_only(True)
                window.active_view().set_scratch(True)
            except :
                pass

        elif os.path.isdir(path):
            if not preview_view :
                show(window, path)
            else :
                show(window, path, view_id=preview_id)
            window.active_view().set_name("Preview: " +  window.active_view().name())
            self.view.settings().set('preview_id' , window.active_view().id())

        window.focus_group(groups[0])
snippet-lister.py 文件源码 项目:st-user-package 作者: math2001 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def on_highlighted(self, index):
        path = os.path.join(self.SNIPPETS_PATH, self.all_snippets[index])
        self.window.open_file(path, sublime.TRANSIENT)


问题


面经


文章

微信
公众号

扫码关注公众号