Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sublime update breaks colour scheme – minimap_control from Theme no longer drawn(/drawn below) if override exists for background in the Colour Scheme with non-zero alpha #5796

Closed
nabijaczleweli opened this issue Dec 27, 2022 · 4 comments

Comments

@nabijaczleweli
Copy link

Description of the bug

When scrolled off the end:

And when in the middle of a file:

Steps to reproduce

Nexus.tmTheme:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>name</key>
  <string>Nexus</string>
  <key>settings</key>
  <array>
    <dict>
      <key>settings</key>
      <dict>
        <key>background</key>
        <string>#2B2B2B</string>
      </dict>
    </dict>

    <dict>
      <key>name</key>
      <string>Source</string>
      <key>scope</key>
      <string></string>
      <key>settings</key>
      <dict>
        <key>background</key>
        <string>#23232301</string>
      </dict>
    </dict>
</array>
  <key>uuid</key>
  <string>B80CD0D8-613C-46FD-9C06-A1201108BC2A</string>
</dict>
</plist>

Afterglow-orange2.sublime-theme:

[
    {
        "class": "minimap_control",
        "viewport_color": [255,255,255],
    }
]

or

[
]

(either works, even empty! the opacity of the colour is also irrelevant here)

  1. Safe mode
  2. Copy both files above into Sublime Text (Safe Mode)/Packages/User
  3. Preferences:
     {
     	"color_scheme": "Packages/User/Nexus.tmTheme",
     	"theme": "Afterglow-orange2.sublime-theme"
     }
  4. The moment you save, you should notice that the minimap viewport hides behind the minimapped content of the preferences (in files taller than the screen this means you don't get a viewport at all):
  5. Now edit the #23232301 into #23232300 (this is equivalent to removing the second <dict> stanza): the viewport is shown again

Expected behavior

The viewport is always drawn.

Actual behavior

It's hidden by the minimap body.

Sublime Text build number

4147

Operating system & version

Windows 10

(Linux) Desktop environment and/or window manager

No response

Additional information

The samples are ugly as sin since I've reduced them to the barest minimum. This was found on a full normal theme.

I think I updated from a build no older than 4146 or 4141 where this still worked.

OpenGL context information

No response

@deathaxe
Copy link
Collaborator

Minimap viewport rendering has been updated to improve contrast/visibility (see: https://forum.sublimetext.com/t/minimap-slider-too-bright-in-breakers-scheme/66310).

Selections or other kinds of code highlighing is no longer covered by the viewport.

That said, assigning a background to an empty scope (2nd dict) seems weird. It doesn't seem to make sense at all, cause that's already covered by normal background setting.

As soon as a scope such as source is added, viewport is visible again.

    <dict>
      <key>name</key>
      <string>Source</string>
      <key>scope</key>
      <string>source</string> <!-- "source" added here -->
      <key>settings</key>
      <dict>
        <key>background</key>
        <string>#23232301</string>
      </dict>
    </dict>

@nabijaczleweli
Copy link
Author

Sorry, I should've explained this better, you got bamboozled by the reduction.

The original tmTheme has scope=<string>source</string>. But this only selects some syntaxes, like C++:
C++
(note the viewport being hidden here!)

But not Plain Text:
Plain Text
or Mandoc:
Mandoc
(the viewport is visible for both)

Setting this to the empty string matches all syntaxes and gives the desired effect everywhere (darker background in the text area taken up by the file, default lighter background everywhere else – cf. the C++ example; this is an important usability feature for me).

The override to <string>#23232301</string> is a limiting case to contrast <string>#23232300</string> – my actual theme specs <string>#232323</string>, which functions for the purposes of this bug the same way as #...01; the surprising bit is that #...00 functions as-if the override didn't exist.

Please observe the following short video in which I demonstrate this effect, with scope=<string>source</string> the way you like (I forced the tmTheme view to be syntax=C++, since XML also doesn't match the source selector):

2022-12-27.15-00-20.mp4

The effect is identical if you set scope= (since all strings contain/are prefixed by the empty string).

@BenjaminSchaaf
Copy link
Member

Fixed in build 4148.

@nabijaczleweli
Copy link
Author

yep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants