ProgerXP / Notepad2e

Word highlighting, simultaneous editing, split views, math evaluation, un/grep, comment reformatting, UAC elevation, complete regexps (PCRE), Lua lexers, DPI awareness and more (XP+)
Other
370 stars 52 forks source link

Precedence of background colors in Scintilla styles #448

Open ProgerXP opened 1 year ago

ProgerXP commented 1 year ago

From what I know, Scintilla 3.x has two kinds of background colors: non-transparent solid color under text and semi-transparent color fill above text. Notepad2 is using the second approach but it leads to poor contrast - for example, gray fill over selected text (black) so that not only selection's background becomes non-white but the text itself becomes non-black.

Luckily, Notepad2 allows using the first approach (non-transparent color under text) by simply removing alpha:N from the style's settings. However, if you remove it from Selected Text or Current Line Background and put selection or caret over a region like /regexp/ (that has its own non-alpha background in JS scheme) you will see that selection's/line's background entirely replaces the regexp's.

Is there a way to specify precedence for styles? So that Current Line Background can't overlay more specific styles (like that of regexp). Notepad++ handles this well even though it doesn't even permit transparency in style colors but is using background a lot:

<script>
var x
var [y]

Can we do the same?


On a related note, why removing alpha from Current Line Background causes Matching Braces to be drawn on white background whilst that style has no back setting?