Home Download Buy Blog Forum Support

Extending SideBar, questions, suggestions

Extending SideBar, questions, suggestions

Postby tito on Sun Oct 09, 2011 1:31 am

Hi there,

I've developed a plugin which adds some cool commands(cut, copy, paste, duplicate, find, etc) to the file tree (sidebar) and I've some questions and suggestions:

Questions:
- Is there a way to receive as argument the multiples items selected in the sidebar? Looks like you can receive just the 'clicked' element.
- I've added some items to the context menu which replace the built-in menus. Is there a way to hide the Default items? Then users, don't need to remove these manually. For example, when the plugin is installed there is two "New File.." items until you remove these manually from "Default/Side Bar.sublime-menu".
- Is there some API for a file/folder picker OS dialog returning the path selected by the user?

Suggestions:
- It seems a click on a folder, opens the folder. It would be nice if a click "select" the item instead(as in files) (Also, allow multiple selections of files and folders at the same time.). Expand of a folder contents can be done in the standard way: click on twisty or double click the folder name as in Mozilla trees. This will allow us to "operate" with these items.. such cutting, deleting or compressing two folders or more and maybe some items, all in one shot.

Comments:
- I'm a windows user and I like the sidebar "tree", even with the Mac style (I'm not a fan of Apple). I found the animation distracting. Just the important : missing multiple selection.

Thanks in advance.
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 849
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: Extending SideBar, questions, suggestions

Postby nobleach on Tue Oct 11, 2011 4:21 pm

One of the behaviors I seriously miss from Textmate... and it's truly a small thing... is the ability to drag a filename of an image from the list/pane into an HTML file and have it automatically show up as img src="path/to/image.jpg" width="200" height="200" .

This cut down on my sometimes brain-dead behavior of typing too quickly and specifying a filename with no extension. This sadly will still display on a Mac... but not on any other environment. It also helped me be far better with 508 compliance as my alt attributes and width and height attributes were already filled out.

I wrote some python to get all this info from a file back a few months ago. But it didn't appear that Sublime allowed the drag n' drop ability with the sidebar.

Maybe a relative path/img src menu item could be in order?
nobleach
 
Posts: 48
Joined: Thu Jun 23, 2011 4:14 pm

Re: Extending SideBar, questions, suggestions

Postby tito on Wed Oct 12, 2011 5:28 am

Hi nobleach
Drag & drop API hooks and multiple selection args will be awesome for users.

Please use the following topic about the plugin. Here I asked very specific questions.
viewtopic.php?f=5&t=3331

BTW, I've added a lot of menus to allow copy text in various formats. check it Image
Not exactly what you want but is very close, will look on how to check image sizes at some point.

Regards,
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 849
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: Extending SideBar, questions, suggestions

Postby jps on Thu Oct 13, 2011 1:23 pm

tito wrote:- Is there a way to receive as argument the multiples items selected in the sidebar? Looks like you can receive just the 'clicked' element.

If your menu entry has any of these arguments, they'll be expanded into a list, with one item per-selected entry in the side bar (open files excluded):
- paths: files or dirs
- files: files only
- dirs: dirs only

Take a look at Diff/diff.py and Diff/Side Bar.sublime-menu for an example

tito wrote:- I've added some items to the context menu which replace the built-in menus. Is there a way to hide the Default items? Then users, don't need to remove these manually. For example, when the plugin is installed there is two "New File.." items until you remove these manually from "Default/Side Bar.sublime-menu".

This isn't possible atm

tito wrote:- Is there some API for a file/folder picker OS dialog returning the path selected by the user?

Not yet, unfortunately
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Extending SideBar, questions, suggestions

Postby tito on Thu Oct 13, 2011 4:15 pm

If your menu entry has any of these arguments, they'll be expanded into a list, with one item per-selected entry in the side bar (open files excluded):
- paths: files or dirs
- files: files only
- dirs: dirs only

Thanks. These lists only contains one item for me. I can't see why. Tested on clean profile 2126 WindowXP. For some reason I only receive 1 item for each of these arguments and no error. Is there an explanation?
Regards
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 849
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: Extending SideBar, questions, suggestions

Postby jps on Thu Oct 13, 2011 10:32 pm

tito wrote:Thanks. These lists only contains one item for me. I can't see why. Tested on clean profile 2126 WindowXP. For some reason I only receive 1 item for each of these arguments and no error. Is there an explanation?
Regards

Have you selected multiple files? Assuming so, does the Diff Files menu item appear when you have two files selected?
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Extending SideBar, questions, suggestions

Postby tito on Thu Oct 13, 2011 11:08 pm

I can't see the diff menu, is not there. ( clean profile ), even tested this on Linux Fedora.
Paths, folders and files always contain 1 item max I even inspected is_enable on diff and other commands.
I'm using ST since some weeks, and it never allowed me to operate with many files. Just one operation at the same time.

If you are going to look into this, can you please, please allow highlight of folders, then we can see which of these are selected. Thanks.
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 849
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: Extending SideBar, questions, suggestions

Postby jps on Fri Oct 14, 2011 4:26 am

Ctrl+Click (Command+Click on OSX) will select multiple files.

The diff command will show up only if the selected files are in the 'FOLDERS' section, and not the 'OPEN FILES' section
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Extending SideBar, questions, suggestions

Postby tito on Fri Oct 14, 2011 7:18 pm

As already reported here too viewtopic.php?p=15920#p15920 There is a bug there.
On linux ( fedora gnome ) and WinXP at least, you can't select multiples items.

There is other bug:
Folders are not highlighted when you select these. Means when you try context menu on some, you don't know which of these are selected. Reproduce: click some files and some folders with Ctrl and only files are highlighted.

Thanks
Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 849
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: Extending SideBar, questions, suggestions

Postby inequity on Wed Oct 19, 2011 4:39 am

I would really love an "Open CMD in directory" option
inequity
 
Posts: 1
Joined: Wed Oct 19, 2011 4:35 am

Next

Return to Plugin Development

Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests