scintillua icon indicating copy to clipboard operation
scintillua copied to clipboard

Cursor / Caret not visible in dark theme in SciTE

Open clach04 opened this issue 4 months ago • 5 comments

I don't see any references to caret or cursor in the code base.

This means if https://github.com/orbitalquark/scintillua/blob/4162857cfa844b449c6b47ce5f42622950b108f5/scintillua.properties#L17 is modified to use dark theme instead, the cursor is invisible.

It looks like the only real option is to set the SciTE caret color manually, rather than a scintillua setting. For example:

# Red cursor/caret, as a demo
caret.fore=#FF0000
#caret.fore=$(scintillua.colors.red)
# Below do NOT work
#caret.fore=fore:$(scintillua.colors.red)  # sort of works, caret/cursor visible - but it's not red!
#caret=fore:$(scintillua.colors.red)  # does not work
#scintillua.styles.caret.fore=#FF0000  # does not work, does not appear to be a named/used style setting

clach04 avatar Jul 10 '25 03:07 clach04

Question; is this expected? I.e. use scite settings for cursor colors or is this something the theme system should take care of?

I suspect, considered a scite setting, but want confirmation before I start hacking away 😉

clach04 avatar Jul 10 '25 04:07 clach04

Yes, this is expected. Scintillua themes only apply to the lexer styles. Non-lexer themed objects like carets and selections are outside the scope of Scintillua.

orbitalquark avatar Jul 11 '25 02:07 orbitalquark

I think we have a few bugs in the Dark theme provided as a sample. It's pretty ugly when using Dark as the cursor, selection, and margins are set to default light settings. As the Dark theme has hard coded colors, this would need to be fixed individually based on comments in #170 . I have a working theme framework proof of concept that resolves this (it needs a little bit of polishing), which I've attached a snippet below:

# base16 - Dark
## highlighted/selected line - base02 - Selection Background
# ensure selection background is under text, so can see text
selection.layer=1
#selection.back=#RRGGBB
#selection.fore=#RRGGBB
#selection.alpha=NN (where NN is a number from 0 to 255, representing the alpha value for transparency, e.g., 75 for some transparency). 
# $(scintillua.colors.base02)
selection.back=$(scintillua.colors.base02)
#selection.fore=$(scintillua.colors.base05)

# setting fore to nothing has no positive impact. Suspect either set fore to something or set alpha transparancy
#selection.fore=
#selection.alpha=75

caret.fore=$(scintillua.colors.base05)
# NOTE caret has additional options https://scintilla.org/SciTEDoc.html

#current line where cursor is
# highlight the current line from the cursor
# TODO review
caret.line.back=$(scintillua.colors.base01)
#caret.line.back.alpha=63


#fold.margin.colour=$(scintillua.colors.base01)
fold.margin.colour=$(scintillua.colors.base00)
# highlight is a mask, set to zero to get fold.margin.colour
fold.margin.highlight.colour=#000000
#fold.margin.highlight.colour=#00000099
#fold.fore=$(scintillua.colors.fg_0)
#fold.fore=$(scintillua.colors.base05)
fold.fore=$(scintillua.colors.base06)

clach04 avatar Jul 15 '25 02:07 clach04

I have a dark theme that seems to work properly, https://github.com/orbitalquark/scintillua/discussions/173 and https://github.com/clach04/scintillua-tomorrow-theme

clach04 avatar Jul 16 '25 04:07 clach04

Alternative workaround: use a different theme/color scheme - see https://github.com/orbitalquark/scintillua/discussions/174

clach04 avatar Jul 31 '25 04:07 clach04