whitequark / rainbowth

Rainbowth is a Sublime Text 3 plugin that highlights matching parentheses in Lisp source code.
54 stars 19 forks source link

delimiters overwrite parts of adjacent characters #8

Open mnewt opened 9 years ago

mnewt commented 9 years ago

Parts of characters are getting overwritten.

Example code:

(defn function [mom]
  (map 
    #(make %) [mom dad]))

With rainbowth: screenshot

Without rainbowth: screenshot

Notice that italics make it worse, but it happens with non-italic characters as well.

On ST3 3083, OSX, MacBook Air 13, relevant settings:

    "color_scheme": "Packages/User/Monokai.tmTheme",
    "font_face": "Monaco",
    "font_size": 12,
whitequark commented 9 years ago

I'm afraid there is nothing I can do to fix this. It happens on the intersection of Sublime's rendering engine and the metrics of your font, neither of which I can control in any way.

mnewt commented 9 years ago

Ah, I thought that might be the case. Thanks for clarifying.

Do you know why it only happens when rainbowth colors the delimiters?

whitequark commented 9 years ago

Try turning subpixel antialiasing off (in Sublime or OS X globally)

mnewt commented 9 years ago

Still the same problem. Not as severe, but still there.

rainbowth: screenshot No rainbowth: screenshot

whitequark commented 9 years ago

This doesn't happen at all for me on Linux. Guess it's some kind of OS X-specific bug.

mnewt commented 9 years ago

Fair enough. When I have some more time, I'll try and figure out why this is happening and reply back. In the meantime, I'll keep using rainbowth, because even with this issue it's still awesome.

mnewt commented 9 years ago

Observe the same issue occurring in other operating systems.

Windows 8.1: image

Linux (Arch GNOME 3): screenshot

And without rainbowth: screenshot

Both of these are using the latest respective beta of Sublime Text 3, 3083, default font settings and default Monokai theme.

whitequark commented 9 years ago

Ah. Right. I can reproduce this on my Linux install too.

The problem is that if I leave the background transparent, Sublime draws the border around the letter with the foreground color, instead of changing the color of the letter. My fix to that consisted of extracting the default background color (and for highlighted line too), and setting it explicitly. And some letters, notably % or italic m, are intersecting with the background that it draws. Since my highlighting schemes do not use italic, I did not notice it initially.

I entirely understand how irritating it is. This should be reported and fixed upstream. However, Sublime's channels to report bugs upstream are really terrible and I have never got an useful response before. So I will leave it to someone with more time and motivation on their hands to triage this issue, because right now I have neither, not for this issue.

whitequark commented 9 years ago

It might be possible to rollback to an earlier Sublime version meanwhile, like around 3060 or so. Not satisfactory, I know.

skimania commented 7 years ago

+1 for this affects me and I want a fix. Just found the package, which I have been desperately wanting, but don't really think I can use it without this fix.

whitequark commented 7 years ago

Try complaining to the developer of Sublime Text. There's nothing I can do about it.