Sublime Forum

Transparent caret

#1

Hi.
ST lets us make our caret block-wide with, say,

 "caret_extra_width": 6

However, the caret then hides the character beneath it.
And it blinks too slowly. This slows me down and leads to typing errors.

Can I make the caret semi-transparent?

0 Likes

Dev Build 3075
Dev Build 3075
#2

Yes. Modify the “caret” key in your color scheme and add an alpha channel. If it doesn’t exists you need to add it.

You can also change the blink style with the “caret_style” setting.

0 Likes

#3

[quote=“FichteFoll”]Yes. Modify the “caret” key in your color scheme and add an alpha channel. If it doesn’t exists you need to add it.

You can also change the blink style with the “caret_style” setting.[/quote]

Any chance of a little more info on this? Using 4 hex byes for the colour code doesn’t work here on ST3.

Cheers :smile:

0 Likes

#4

Well, it does work here. I just changed it from

<key>caret</key> <string>#FFFFFF</string>
to

<key>caret</key> <string>#FFFFFF50</string>

0 Likes

#5

@FichteFoll

Just tried that same code here and it doesn’t work. Perhaps it’s a platform thing (Windows 7, 64 bit). Would love to know why since I’d prefer a block cursor, but the cursor occluding the underlying character is a deal breaker for me.

:smile:

0 Likes

#6

With your

"caret_extra_width": 6

setting I was able to see the problem (not exactly visible with the 1px-wide caret): The caret is not actually drawn transparently, instead the color is determined by layering the caret color on top of the background color (with transparency applied). So a color with alpha channel 0x00 will give you a caret that has the same color as the background, not an invisible caret.

Might wanna report this at github.com/SublimeTextIssues/Core/issues

0 Likes