Sublime Text 2 - Link with Editor / Show file in sidebar

后端 未结 5 1697
时光取名叫无心
时光取名叫无心 2020-12-13 01:59

I\'m looking for a feature like Eclipse\'s Link with Editor. Basically, I want whatever file I\'m editing to be shown in its place in the file tree.

5条回答
  •  借酒劲吻你
    2020-12-13 02:39

    I tested the solution proposed by Albert Català, but it causes an error when a popup window appears, with the 'Quick Switch Projects' command for example.

    So here is my modified version to avoid errors :

    import sublime
    import sublime_plugin
    
    class LinkWithEditor(sublime_plugin.EventListener):
    
        def on_activated(self, view):
            if view.window() is not None:
                view.window().run_command('reveal_in_side_bar')
    

    Hope this help!

提交回复
热议问题