Sublime Forum

Reveal in Sidebar, Copy File Path misplaced

#1

Reveal in Sidebar, Copy File Path and Reveal in Finder are items in right click context menu in text editing area are misplaced.
Those items belong to file system rather than to file content so… their proper place is in context menu of tab that represents file entity but not content entity.
I think this is also a common behavior for all major IDE and text editors

0 Likes

#2

Look, it’s all just abstractions and metaphors anyway, so what’s better or “proper” is really just whatever you think it is.

0 Likes

#3

Your answer is exactly true, this is all philosophy, metaphors and personal perception.
Could those be duplicated in tab at least?

0 Likes

#4

The following is a forum answer where someone was asking something similar to what you’re asking, which tells you how you would go about adding the Copy File Path and Open Containing Folder (which I assume is what you mean by Reveal in Finder?) options to the context menu of file tabs:

In order to add Reveal in Sidebar to the tab context menu, you can add the following code to the custom_tab_commands.py plugin code:

class RevealInSideBarTabCommand(sublime_plugin.TextCommand):
    def run(self, edit, group, index):
        target = view_target(self.view, group, index)
        window = target.window()
        window.focus_view(target)
        window.run_command("reveal_in_side_bar")

    def is_enabled(self, group, index):
        target = view_target(self.view, group, index)
        return target.file_name() is not None

With that in place you can add the following menu item to the Tab Context.sublime-menu file to enable the option.

{ "command": "reveal_in_side_bar_tab", "args": {"group": -1, "index": -1}, "caption": "Reveal in Side Bar" },
1 Like