Community
    • Login

    dark mode & Compare plugin

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 5 Posters 9.0k 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.
    • Phantom LordP
      Phantom Lord
      last edited by

      Hi, if I enable dark mode and with the Compare Plugin I compare 2 text files, the colors are messy, and I cannot understand anymore which lines is moved/changed/removed/added, Contrast between colors are messy. Please solve

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Phantom Lord
        last edited by

        @Phantom-Lord ,

        Please solve

        That is an issue with the Compare plugin itself, and would have to be solved in the codebase of the Compare plugin, by the developer of the Compare plugin. (The vast majority of users in this Forum, even the regulars, are not the developer of that plugin, and thus cannot solve your problem for you.)

        However, the Compare plugin development has been discontinued by its developer, to be (eventually) replaced by an upcoming ComparePlus plugin.

        So, until the developer of the plugin releases ComparePlus, or goes back to supporting the existing Compare plugin, you may have to wait or switch back to non-Dark mode when using Compare (unless you have the skills necessary to fork the Compare plugin’s codebase and make the fixes yourself).

        dfs-D PeterJonesP 2 Replies Last reply Reply Quote 2
        • Paolo ParonuzziP
          Paolo Paronuzzi
          last edited by

          Hello,

          I do not know if you solved the problem in the meanwhile. But, I found out an easy way to overcome this issue: if you go in plugin -> compare -> settings, then you can change the colors used to highlight the differences between the files. If you choose very dark colors, then everything becomes very better. And you can use dark mode ;-)

          1 Reply Last reply Reply Quote 6
          • dfs-D
            dfs- @PeterJones
            last edited by

            @peterjones said in dark mode & Compare plugin:

            However, the Compare plugin development has been discontinued by its developer, to be (eventually) replaced by an upcoming ComparePlus plugin.

            Which should happen soon, if this statement applies: https://github.com/pnedev/compare-plugin/issues/278#issuecomment-1042680128

            1 Reply Last reply Reply Quote 1
            • PeterJonesP
              PeterJones @PeterJones
              last edited by PeterJones

              @peterjones said in dark mode & Compare plugin:

              So, until the developer of the plugin releases ComparePlus, or goes back to supporting the existing Compare plugin

              For future readers: I was an idiot in July 2021, for not trying to look at the settings of the Compare plugin. There was no reason for me to have given such awful advice last year. (Other than I never use Dark Mode, except to help others here, so I had never been prompted to go looking how to change the colors in the Compare plugin.)

              As I had realized by this discussion in December, and was reminded again recently,* it is easy enough to use the Plugins > Compare > Settings to change the colors and make everything readable again in Dark Mode. (And I see again that @Paolo-Paronuzzi had already said this.)

              No changes need to be made to the source code of Compare plugin in order to support Dark Mode; you do not have to wait for ComparePlus to release (though I do anxiously await its advent): when you switch to Dark Mode, change the existing Compare plugin color settings to colors you like. It’s as simple as that.

              1 Reply Last reply Reply Quote 4
              • PeterJonesP PeterJones referenced this topic on
              • Sserddae KaflaerS
                Sserddae Kaflaer
                last edited by

                Hi there, this is my first post on the Notepad++ forum (or any software related forum for that matter), so please do forgive any inadvertent violation of forum etiquette.

                I’m in the middle of developing two scripts to switch my new Linux Mint 20.2 Cinnamon desktop (I left Windows 7 behind less than a month ago) and my favorite applications between light and dark mode. Since I’m still using Notepad++ (via PlayOnLinux, mainly because of the Compare plugin), I had a look at tweaking the color schemes for both Notepad++ and the Compare plugin. It was one of the tougher nuts I had to crack so far, but I managed to put something together that seems to work like a charm (at least for now and for me).

                Switching on dark mode in Notepad++ and setting a convenient Compare color scheme can be done with the following (linux!) script.
                (Plug in your username and the right linux path to the PlayOnLinux/Wine folder containing Notepad++. Don’t touch the double backslash \\ in the sed command arguments! They’re there to escape the backslashes in the Windows paths used by Notepad++.)

                #!/bin/sh
                
                #
                # Activate Notepad++ dark mode
                #
                
                cd "<path up to the PlayOnLinux virtual drive letter>/drive_c/users/<username>/Application Data/Notepad++/"
                sed -i.bak 's/<GUIConfig name="DarkMode" enable="no"/<GUIConfig name="DarkMode" enable="yes"/' ./config.xml
                sed -i.bak 's/<GUIConfig name="stylerTheme" path="C:\\users\\<username>\\Application Data\\Notepad++\\stylers.xml"/<GUIConfig name="stylerTheme" path="C:\\Program Files\\Notepad++\\themes\\DarkModeDefault.xml"/' ./config.xml
                
                #
                # Modify Notepad++ Compare plugin color scheme
                #
                
                cd "<path up to the PlayOnLinux virtual drive letter>/drive_c/users/<username>/Application Data/Notepad++/plugins/config/"
                cp ComparePlugin.DarkMode.ini ComparePlugin.ini
                

                The (dark) text background colors used by Compare in dark mode are defined in the file ComparePlugin.DarkMode.ini (see below), which is copied to the ComparePlugin.ini config file by the script.

                [Main]
                Old is First=1
                Old on Left=1
                Default Compare is to Prev=1
                Go to First Diff=0
                Check Encodings=1
                Wrap Around=0
                Compact NavBar=1
                Ignore Spaces=0
                Detect Moves=1
                Navigation Bar=1
                [Colors]
                Added=32768
                Removed=128
                Changed=8388608
                Moved=8388736
                Highlight=255
                Alpha=100
                
                

                My Compare dark mode color scheme looks like this.

                Compare dark mode.png

                To switch back to light mode, you can use the following script.

                #!/bin/sh
                
                #
                # Deactivate Notepad++ dark mode
                #
                
                cd "<path up to the PlayOnLinux virtual drive letter>/drive_c/users/<username>/Application Data/Notepad++/"
                sed -i.bak 's/<GUIConfig name="DarkMode" enable="yes"/<GUIConfig name="DarkMode" enable="no"/' ./config.xml
                sed -i.bak 's/<GUIConfig name="stylerTheme" path="C:\\Program Files\\Notepad++\\themes\\DarkModeDefault.xml"/<GUIConfig name="stylerTheme" path="C:\\users\\<username>\\Application Data\\Notepad++\\stylers.xml"/' ./config.xml
                
                #
                # Modify Notepad++ Compare plugin color scheme
                #
                
                cd "<path up to the PlayOnLinux virtual drive letter>/drive_c/users/<username>/Application Data/Notepad++/plugins/config/"
                cp ComparePlugin.LightMode.ini ComparePlugin.ini
                

                and either the color definitions in the original ComparePlugin.ini (copy it to ComparePlugin.LightMode.ini) or my personal color definitions given below.

                [Main]
                Old is First=1
                Old on Left=1
                Default Compare is to Prev=1
                Go to First Diff=0
                Check Encodings=1
                Wrap Around=0
                Compact NavBar=1
                Ignore Spaces=0
                Detect Moves=1
                Navigation Bar=1
                [Colors]
                Added=8454016
                Removed=8421631
                Changed=8454143
                Moved=16744703
                Highlight=16776960
                Alpha=100
                
                

                In light mode, my Compare color scheme looks like this.

                Compare light mode.png

                For those who don’t like my color schemes: you can calculate the decimal color code from a (R,G,B) color definition using the formula R + G x 16 + B x 16^2 (which is not the same as just converting the hexadecimal RGB code to decimal).

                I know I’m a bit late with this solution and that the ComparePlus plugin maybe solves the problem altogether, but I hope this is helpful anyway.

                Sserddae KaflaerS 1 Reply Last reply Reply Quote 0
                • Sserddae KaflaerS
                  Sserddae Kaflaer @Sserddae Kaflaer
                  last edited by

                  I forgot to mention some things in my earlier post:

                  • The scripted switch between light and dark mode doesn’t work while Notepad++ is open. You have to close it, run the script and open it again (should be no problem if Notepad++ remembers the current session for the next launch and regular backups are made).

                  • For Linux-users: setting custom colors in the Compare plugin settings windows doesn’t work (at least on my Mint box, probably because of a link to a missing Windows system color picker). You have to modify the color codes manually in the config files. If you stick to dark mode all the time, you can just set the custom colors once in ComparePlugin.ini and omit the custom light and dark config files and the switching scripts.

                  • @Phantom-Lord: coincidentally, I called my script to switch to light mode “Hit the lights” (Metallica in-joke).

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