Cannot clear "inherit" fg/bg in styler [Possible Bug]
-
I think I’ve found a bug, but before I report it, can anyone confirm whether they see the same thing I’m seeing?
If I have set a particular style to “inherit” (ie, right-click on both the FG and BG colors so they have the cross-hatch, and thus inherit from the DEFAULT style for the active theme), after I restart, if I change back to non-inherit and save that style, if I restart again then check, it’s back to inherit.
Steps to Reproduce
- Fresh 8.5.7 portable
- restart Notepad++
- Style Configurator > Perl > INSTRUCTION WORD: use right-click to set fg=inherit, bg=inherit; save & close
- restart Notepad++
- Style Configurator > Perl > INSTRUCTION WORD: use right-click to set fg=not-inherit, bg=not-inherit; save & close
- restart Notepad++
- Style Configurator > Perl > INSTRUCTION WORD: it’s inherit again! it should be not-inherit!
Tried the same with Python > KEYWORDS: if you set it inherit, it properly saves. If you set it non-inherit, it does not.
I tried with default theme
stylers.xml
or the DefaultDarkTheme, with same results.If I set FG=non-inherit and BG=inherit in step-3, and both=non-inherit in step-5, step-7 still shows FG=non-inherit, BG=inherit.
If I set FG=inherit and BG=non-inherit in step-3, and both=non-inherit in step-5, step-7 still shows FG=inherit, BG=non-inherit.My guess is that it’s because having no
colorStyle
attribute in stylers.xml/themename.xml means “non-inherit”, butcolorStyle="0"
means inherit-FG+and+BG,colorStyle="1"
means inherit-BG, andcolorStyle="2"
… so when you try to go from having one or more inheritedto none inherited, it doesn’t properly delete that attribute when it saves the stylers.xml/themename.xml. My guess is that an easy fix would be to havecolorStyle="3"
be equivalent to having no colorStyle attribute and not inherit anything, so that if you use the GUI to clear the inherit on both FG and BG, it will set it tocolorStyle="3"
. (I would think that would be easier than figuring out when to delete thecolorStyle
attribute, but I haven’t looked into the codebase.) -
Yes, I can confirm that this is also the case for me.