Sublime Forum

Extending SideBar, questions, suggestions

#1

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.

0 Likes

#2

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?

0 Likes

#3

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.

BTW, I’ve added a lot of menus to allow copy text in various formats. check it http://dl.dropbox.com/u/43596449/tito/sublime/SideBar/screenshot.png
Not exactly what you want but is very close, will look on how to check image sizes at some point.

Regards,

0 Likes

#4

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

This isn’t possible atm

Not yet, unfortunately

0 Likes

#5

[quote]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[/quote]

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

0 Likes

#6

[quote=“tito”]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[/quote]

Have you selected multiple files? Assuming so, does the Diff Files menu item appear when you have two files selected?

0 Likes

#7

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.

0 Likes

#8

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

0 Likes

#9

As already reported here too Run scripts from sidebar context-menu 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

0 Likes

#10

I would really love an “Open CMD in directory” option

0 Likes

#11

Is this what you’re looking for?
wbond.net/sublime_packages/terminal

0 Likes

#12

A user was able to understand why some of us were unable to select multiples items on sidebar.


I’m testing and the selection has some oddities when using control or shift, it start from the focused file listed in “Open Files” all to the clicked file. I hope you can fix! I would like to disable “Open files” and get multiple selection working!

A minor issue, it would be good to disable toggle of selection when “ctrl key + right click”, because a user may select many files using “ctrl” and then, we don’t remove the finger from the “ctrl key” and just hit “right click” to open the context menu.
Regards

[edit] I made some comments about persistent selection and behaviour of preview feature here Dev Build 2134

0 Likes