Community
    • Login

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

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 406 Views 1 Watching
    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 Offline
      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 Offline
        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

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors