Home Download Buy Blog Forum Support

New/rename/delete item in sidebar shortcuts

New/rename/delete item in sidebar shortcuts

Postby ljwagerfield on Sun Apr 14, 2013 1:02 pm

Please can we have a way to access the context menu commands for the sidebar via shortcuts?

I have considered writing an ApplicationCommand, but these commands require a 'dirs' argument and I'm uncertain how get the currently selected directory from the sidebar via the API.

(Note: super+n is not the same, it doesn't take the context of the sidebar into account!)
ljwagerfield
 
Posts: 4
Joined: Sun Apr 14, 2013 12:58 pm

Re: New/rename/delete item in sidebar shortcuts

Postby robertcollier4 on Sun Apr 14, 2013 2:15 pm

Look for a file named Context.sublime-menu (in the Default package). It contains the sidebar context menu items and their corresponding commands.

And to copy the currently selected directory to clipboard:
Code: Select all
branch, leaf = os.path.split(self.view.file_name())
sublime.set_clipboard(branch)
robertcollier4
 
Posts: 154
Joined: Sun Feb 24, 2013 5:37 pm

Re: New/rename/delete item in sidebar shortcuts

Postby ljwagerfield on Tue Apr 16, 2013 9:44 am

The above commands retrieve the path of the current buffer/view, not the expanded folder in the sidebar.

Consider this: no windows are open and you are expanding directories in the sidebar - I need to be able to retrieve the currently selected directory.
ljwagerfield
 
Posts: 4
Joined: Sun Apr 14, 2013 12:58 pm


Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 6 guests