Skip to content
This repository

highlight modified tabs, text highlight #62

Closed
EdJoJob opened this Issue May 24, 2012 · 18 comments

11 participants

Edward Ian Hill Nicolas Perriault Timo Borreck Diego Geovani de Souza Antonio Parisi mathiasson Stephen Horne Steven Lu Matias Mancini
Edward
EdJoJob commented May 24, 2012

In the default theme, the tab highlight changed the tab text to be orange, which made it very easy for me to see the modified tabs.

Unfortunately, the small circle currently used over the close button is far less obvious. I would like to have both of these options please.

Nicolas Perriault
n1k0 commented June 17, 2012

+1

Timo Borreck
tbor commented July 06, 2012

+1

Diego
vemec commented July 08, 2012

+1

mathiasson

For me, modified/dirty tabs does not change at all.

Using Sublime build 2217 on OS X. It does work as expected with the default theme.

Should I open this as a separate issue?

UPDATE: It turns out that you need "highlight_modified_tabs" turned on, to get any highlight at all of modified tabs (that is, the circle instead of the closing x).

With the default theme, the circles are used even without that setting.

Stephen Horne

I was looking for an answer to the tab highlight colour as well, then I managed to implement it with some fettling of the "Soda Dark.sublime-theme" file. I added the following dictionary:

//
// TAB LABELS
//

    {
        "class": "tab_label",
        "parents": [{"class": "tab_control", "attributes": ["dirty"]}],
        "fg": [253, 136, 1],
        "shadow_color": [35, 35, 35]
    },

This is a hack, as it will ignore the "highlight_modified_tabs" setting in Preferences.sublime-settings, so setting this to false will not change the dirty labels back to grey.

Ian Hill
Owner

Hi folks,

Here's an update on all things highlight_modified_tabs related :)

Soda Theme has been updated with a few changes to the dirty tabs indicator. For now both themes have had their logic adjusted (explained below), but the new graphics have only been applied to Soda Light with Soda Dark currently in progress.

Here's a summary of the changes:

  • The subtle / basic dirty tabs indicator now displays by default whenever there are unsaved changes. This behaviour matches the default ST2 theme and brings back how Soda Theme used to treat unsaved tabs a few updates back. Hopefully that will avoid further confusion for anyone who noticed the indicator was no longer appearing and wondering what was going on.

  • A new design for the more prominent / obvious indicator has been added to Soda Light (Soda Dark coming soon), that can be opted into via the highlight_modified_tabs option. This indicator will hopefully benefit some people looking for a clearer indicator, while allowing those who dislike the stronger visual feedback to opt out by not applying the setting.

  • And lastly, for people interested in bringing back coloured text labels for their modified tabs - I've added a new wiki page that walks through how to take advantage of Sublime Text's User Theme feature, as it's a great mechanism for applying personal tweaks to your own setup without the hassle of having to maintain a duplicate copy of a theme, or re-applying changes each time the theme is updated.

User Theme Customisation
https://github.com/buymeasoda/soda-theme/wiki/Theme-customisation

The user theme customisation wiki page walks through how to use the user theme feature, and includes some sample theme tweaks, one of them being a demo of how to implement coloured text labels for dirty tabs :) The great thing about user themes is if you create and apply a user theme change, you won't have to re-apply the tweak each time the base theme updates.

Hope that helps.

Stephen Horne

It does, thanks Ian =]

Steven Lu

I was able to get the colored text labels working, it's very nice. But what'd be sweet is if the entire tab could be colored. Is this impossible now?

Ian Hill
Owner

@unphased you can use the tint property to adjust the rendered colours of the UI assets (where implemented by ST2).

For example, to tint the whole background of modified tabs for Soda Dark you would add something like the following to your User Theme file:

// Tint Soda Dark modified tabs blue
{
    "class": "tab_control",
    "attributes": ["dirty"],
    "layer0.tint": [100, 200, 250]
}

Or for Soda Light:

// Tint Soda Light modified tabs blue
{
    "class": "tab_control",
    "attributes": ["dirty"],
    "layer0.tint": [230, 240, 255]
}
Steven Lu

Great!!!

Thanks. Now there are three indicators of edited buffers, which is honestly a bit overkill. the tinted tab looks excellent and I could actually do without the indicator now (so it doesn't shift the tab layout around -- I have "show_tab_close_buttons" off). Turning off "highlight_modified_tabs" no longer removes it.

I hate making my comment sound like a complaint though. It's pretty much fantastic. Love this editor (and its plugins) so much.

Ian Hill
Owner

Haha, the curse of the highlight_modified_tabs indicator continues :D

For your situation - wanting close buttons off, with no default indicator for dirty tabs (other than your colour tint), and without any visible change in tab size occurring - add the following rules to your User Theme file to accompany the above tab tint rule:

{
    "class": "tab_control",
    "settings": ["!show_tab_close_buttons"],
    "attributes": ["dirty"],
    "content_margin": [12, 3]
},
{
    "class": "tab_close_button",
    "settings": ["!show_tab_close_buttons"],
    "parents": [{"class": "tab_control", "attributes": ["dirty"]}],
    "content_margin": [0, 0]
}
Steven Lu

Somewhat related to this: Do you know how I might be able to get a tab to close by Cmd+clicking it? No middle mouse on my macbook (been simulating it using cmd+click which has worked pretty well so far)

Ian Hill
Owner

@unphased I'm not aware of a shortcut for clicking to close tabs, doesn't mean there isn't one though

Matias Mancini

+1

Ian Hill
Owner

I've just pushed some changes that brings updates for Soda Dark including retina support for the dark version. The adjustments to the dirty tab indicator that were previously made for Soda Light (and outlined a few comments back), have now been added to Soda Dark.

Quick breakdown of the options available:

  • If you want a subtle dirty tab indicator, turn off highlight_modified_tabs
  • For a more prominent indicator, turn on highlight_modified_tabs
  • To adjust the tab label colour, or background colour when there are unsaved changes, see the User Theme tips above
  • And if you want to remove the indicators altogether, see the other User Theme example above

I'll close this issue now, as I'm hoping that'll do it, at least for the moment ;)

Ian Hill buymeasoda closed this July 29, 2012
Nicolas Perriault
n1k0 commented July 29, 2012

That's just great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.