Sublime Forum

(ST3) TabsExtra

#9

IMO (person who likes ontology :P), I believe …
The Tab context menu should be for operations related to the tabbar, and the current file.
The View Context Menu should be for operations about the content of the editor/buffer, not about the file. !

JFYI My tab context menu has been like this from some time dl.dropboxusercontent.com/u/930 … t-menu.png

0 Likes

#10

[quote=“tito”]IMO (person who likes ontology :stuck_out_tongue:), I believe …
The Tab context menu should be for operations related to the tabbar, and the current file.
The View Context Menu should be for operations about the content of the editor/buffer, not about the file. !

JFYI My tab context menu has been like this from some time dl.dropboxusercontent.com/u/930 … t-menu.png[/quote]

This makes sense from author of the sidebar menu plugin :smile:.

I like your menu setup. And I agree with your view on menus. I may borrow from your menu setup some.

The one thing I wish ST allowed that may be difficult for me to solve from a usability aspect, is that ST doesn’t allow augmentation of the menu via modifiers. One thing I would love to add is something like where you press a modifier, and the “close tabs” options change. Like hold ctrl, and now the close tabs options will close saved tabs without a warning dialog. Or hold alt, and the options now will close all tabs but saved tabs.

I was thinking about iamntz’s request, and ideally that is how I would like to approach it, but I can’t. I was thinking that a sticky all unsaved was fine, but now I want to implement close commands that will discard unsaved files automatically without that “Do you want to save?” dialog. I realized I would need yet another toggle…toggles for sticky tabs is fine, but toggling for all variants of a command would get tiresome. I am now thinking the best approach is just to use sub-menus. Though you have to navigate a level deeper, you won’t have to open the menu twice: one to toggle and one to execute. And burying the variants in a sub-menu will keep the top level from getting cluttered with multiple variants of the same command.

Close Tab
Close All
Close Others
Close to Left
Close to Right
----------------
Close Saved Tabs... ->
                                 Tab
                                 All
                                 Others
                                 To Left
                                 To Right
-----------------
Close Tabs (Discard Unsaved) ->
                                               Tab
                                               All
                                               Others
                                               To Left
                                               To Right
-----------------

I am open to suggestions. Anyone care to weigh in?

0 Likes

#11

Okay. Here is the next iteration. Nothing is committed yet.

The anything can be excluded. And the sections can be reordered via the settings file:

[pre=#232628] // Menu layout include or exclude, in whatever order you desire, the following options:
// “close”, “sticky”, “open”, “clone”, “save”, “reveal”, “path”, “revert”]
// When done, go to Preferences->Package Settings->TabsExtra and Install/Upgrade either
// the default TabsMenu or the Override Menu which overrides the “Default” package’s menu.
“menu_layout”: “close”, “sticky”, “open”, “clone”, “save”, “reveal”, “path”, “revert”][/pre]

After re-factoring this. It should be easier for me to extend if I need to, and it should be configurable enough that people can set it up how they like.

If you have any suggestions, comments, or concerns on this new iteration, let me know. I plan on pushing it out maybe in the next two or three days.

0 Likes

#12

Looks good to me!

0 Likes

#13

If I get a chance today, I will try and push it out later. It’s pretty much done. I think I just need to double check everything.

0 Likes

#14

I’ve got an idea, although it might be beyond the scope of this plugin.

It would be cool to be able to have different (customizable) coloured tabs depending the type of file. A quick glance could differentiate between CSS and PHP files, for instance.

Also, will your plugin appear in the Package Manager soon?

Good stuff :smiley:

0 Likes

#15

[quote=“Pwarts”]I’ve got an idea, although it might be beyond the scope of this plugin.

It would be cool to be able to have different (customizable) coloured tabs depending the type of file. A quick glance could differentiate between CSS and PHP files, for instance.
[/quote]

It would require a whole lot that I am just not really interested in doing with this. Tab colors is really controlled by the theme and such.

I haven’t put in a request yet, but I probably will sometime this week. I generally like to post a plugin here first and see the response from people before I make the request. If there is no interest, I usually don’t bother.

0 Likes

#16

Changes were just committed. You should be prompted to with a message explaining how to update your menus.

0 Likes

#17

Apparently in Windows, Tabs Extra would create menus with some funny characters. This was because the horizontal ellipsis (…) was getting converted wrong. Turns out, Python 3, as we all know, uses unicode for all strings. Even though the system returned “utf-8” as the default system encoding, sublime used “cp1252” as the default for all unicode strings…sigh… Not sure why, maybe I am missing something here, but anyways, I provided a quick and dirty patch for it for now.

So, if your menus are showing funny characters for “Save As…” etc., update TabsExtra, and then update your menus. That should fix it.

0 Likes

#18

Win 8.1 here. I didn’t see any issues (and works great, btw!)

0 Likes

#19

Ruh Roh, hopefully I didn’t mess it up for you in the future then…Maybe I need to see if I can detect what the default encoding used by sublime is. Maybe there is something off on my setup.

0 Likes

#20

Appears to have been a local issue for me. I had to delete a sublime-pacakge archived version and then the unpacked one started behaving normally…weird.

0 Likes

#21

FYI

  • Added option to always focus the last active tab when active tab is closed.
  • Also, using the tab close button should now behave properly (they are now detected and the focusing is applied properly after)

This should be ready for prime time now. I will look into adding it to Package Control sometime soon.

0 Likes

#22

Now on Package Control

0 Likes

#23

FYI

  • Clone, Delete, Rename options have been added (technically clone always existed, but I accidentally had it crippled)
  • Added Sort (loosely based on bizoo’s SortTabs - yes I got permissions). The builtin sort options take advantage of TabsExtra more accurate tab activation tracking (it can catch when tabs move to other groups etc. without accidentally activating adjacent tabs). Plus it adds a couple more sort options.

As always, everything is configurable and optional, so look in the settings file and configure what you want to see and what you don’t.

0 Likes

#24

subscribe (sorry :smile:)

0 Likes

#25

TabsExtra should now handle tab index properly when image previews tabs are open. TabsExtra used to get confused because image previews don’t appear in the view list returned from a window object. This would cause the wrong tab to get closed etc. TabsExtra should no longer get confused because it now uses the undocumented sheets API to get all sheets and uses those as indexes since image previews show up as sheets.

You will not be able apply a number of the TabsExtra commands to image previews because image previews are not really views, but you will at least be able to close them with the TabsExtra close commands.

I did also rename the close commands (they were too generic in name), so update your menus!

There were a lot of changes, and I did try to test them well, but let me know if you get some unexpected behaviors (after you’ve updated your menus of course).

0 Likes

#26

I’m not sure about this:

[quote]1. If using the override menu, select “Preferences->Package Settings->TabsExtra->Install/Upgrade Default Override Menu” from Sublime’s menu.

  1. If using the default menu, select “Preferences->Package Settings->TabsExtra->Install/Upgrade TabsExtra Menu” from the menu" from Sublime’s menu.[/quote]

How do i know which one i’m using? :smile:

0 Likes

#27

The Default Override puts all the close options together since I overwrite the the original tab context menu. The other option just appends them at the bottom leaving them separated. I mention it in the readme github.com/facelessuser/TabsExt … nu-options.

So if your close options are NOT all grouped together, you are NOT using the Default Override menu.

0 Likes

#28

If you are using Sublime build 3068 or greater, TabsExtra now works much better. Before there were a number of focus issues that were side effects of configurable tab focus on close. 3068 introduced some improved aspects of the API so that weird tab focus behaviors have hopefully all been eliminated.

If I missed some tab focus corner case bug, please do let me know (but it needs to be something that I currently support; no I don’t currently support custom tab opening positions; if I add them, I will let you know :wink:).

0 Likes