Community
    • Login

    Cannot clear "inherit" fg/bg in styler [Possible Bug]

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 203 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • PeterJonesP
      PeterJones
      last edited by PeterJones

      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

      1. Fresh 8.5.7 portable
      2. restart Notepad++
      3. Style Configurator > Perl > INSTRUCTION WORD: use right-click to set fg=inherit, bg=inherit; save & close
      4. restart Notepad++
      5. Style Configurator > Perl > INSTRUCTION WORD: use right-click to set fg=not-inherit, bg=not-inherit; save & close
      6. restart Notepad++
      7. 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”, but colorStyle="0" means inherit-FG+and+BG, colorStyle="1" means inherit-BG, and colorStyle="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 have colorStyle="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 to colorStyle="3". (I would think that would be easier than figuring out when to delete the colorStyle attribute, but I haven’t looked into the codebase.)

      EkopalypseE 1 Reply Last reply Reply Quote 1
      • EkopalypseE
        Ekopalypse @PeterJones
        last edited by

        @PeterJones

        Yes, I can confirm that this is also the case for me.

        1 Reply Last reply Reply Quote 2
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors