Sublime Forum

(ST3) TabsExtra

#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

#29

My apologies if it is the wrong spot to ask for support. I figured this was the best spot to get help from facelessuser and those that enjoy this plugin.

I find this plugin does a much nicer job for the task Close All Tabs than the function built-in to ST3. Specifically, if I have a pane open, TabsExtra’s function will close only the tabs within the pane I am working and leave the others untouched.

I want to map Close All Tabs to a short-cut key but can’t get it to work. From Tab Context.sublime-menu I copied:

"command": "tabs_extra_close", "args": { "group": -1, "index": -1, "close_type": "all" }

and pasted it in Default (Linux).sublime-keymap like this:

{ "keys": ["alt+f12"], "command": "tabs_extra_close", "args": { "group": -1, "index": -1, "close_type": "all" } },

This is a method I have used for keymapping other functions from plugins and I think it should work.

I am certain there are no keyboard conflicts. I was already using that keyboard combination for the previous Close All Tabs short-cut.

Is there a way to have this function mapped to a keystroke?

0 Likes

#30

This is a command that gets launched from a tab. Sublime sends the command automatically with a valid group and index. You would need to write a wrapper that sends a valid group and index. Maybe the wrapper would grab the active view and use its group and index.

0 Likes