Open pryrt opened 1 year ago
Another user has noticed this and complained about it in the Community. It's not just me seeing this bug. We need to be able to turn on and off the "inherit" flag from the GUI, and have it properly save the setting to be used the next time Notepad++ has run.
They were using 7.9.5. But I was able to confirm it again today using 8.6.8:
Notepad++ v8.6.8 (64-bit)
Build time : Jun 4 2024 - 00:30:00
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line :
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 22H2
OS Build : 19045.4529
Current ANSI codepage : 1252
Plugins :
mimeTools (3.1)
NppConverter (4.6)
NppExport (0.4)
Description of the Issue
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
I tried the same with Python > KEYWORDS: if I set it inherit, it properly saves. If you set them both to 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.
Expected Behavior
Notepad++ should save the state of the "inherit" flags as being non-inherit when they had previously been saved as one-or-both-set-to-inherit and are now changed to neither-set-to-inherit
Actual Behavior
Notepad++ accepted the new neither-set-to-inherit for a single instance, but when exited and restarted, it did not save the new state, and so went back to having the "inherit" flags set on, rather than having no "inherit" flags.
Additional discussion
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"
means inherit-FG ... 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"
. (think that might be easier than figuring out when to delete thecolorStyle
attribute, but I haven't looked into the codebase, so if you'd prefer to implement by deleting the attribute, that's fine.)Debug Information