Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Plugins -> NppExport lost color format in version 7.7.7

    Help wanted · · · – – – · · ·
    9
    14
    2859
    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.
    • musashiharuno
      musashiharuno last edited by

      May I know if others have the similar issue?
      at least, it can be repro in my lab Windows 2008 R2 and latest Windows 10.

      I found the NppExport color format is back after I revert the Npp version to 7.6.6.

      to repro the issue,

      1. copy some C++ or XML txt to the Notepad++
      2. language -> choose C++ or XML
      3. select all text, click Plugins -> NppExport -> copy to RTF
      4. paste in Word,
        when it’s in Npp 7.7.7, color appears all black. when reverting to Npp7.6.6, it shows color format.
      Meta Chuh 1 Reply Last reply Reply Quote 0
      • Meta Chuh
        Meta Chuh @musashiharuno last edited by Meta Chuh

        welcome to the notepad++ community, @musashiharuno

        yes, unfortunately nppexport 0.2.8 is not compatible with notepad++ 7.7.

        see nppexport issue #7.
        and notepad++ issue #5740.

        1 Reply Last reply Reply Quote 2
        • musashiharuno
          musashiharuno last edited by

          I see, thanks for your info @Meta-Chuh

          1 Reply Last reply Reply Quote 1
          • gerdb42
            gerdb42 last edited by

            NppExport.cpp makes use of SCI_GETSTYLEBITS which is deprecated as of scintilla 3.4.4 and returns ‘0’ with the current version. Simply replacing the value with a constant ‘8’ gets NppExport back to function. Can anyone with more insight confirm that this is a feasible way to go?

            1 Reply Last reply Reply Quote 4
            • Michael Vincent
              Michael Vincent last edited by

              @gerdb42 : I made the one change you recommend:

              diff --git a/src/NppExport.cpp b/src/NppExport.cpp
              index 8dee27b..2ae0ceb 100644
              --- a/src/NppExport.cpp
              +++ b/src/NppExport.cpp
              @@ -369,7 +369,8 @@ void fillScintillaData(CurrentScintillaData * csd, int start, int end) {
                      int prevStyle = -1, currentStyle;
              
                      //Mask the styles so any indicators get ignored, else overflow possible
              -       int bits = (int)SendMessage(hScintilla, SCI_GETSTYLEBITS, 0, 0);
              +//     int bits = (int)SendMessage(hScintilla, SCI_GETSTYLEBITS, 0, 0);
              +       int bits = 8;
                      unsigned char mask = 0xFF >> (8-bits);
                      for(int i = 0; i < len; i++) {
                              csd->dataBuffer[i*2+1] &= mask;
              

              on the NppExport source code from GitHub (https://github.com/chcg/NPP_ExportPlugin.git) and recompiled with VS2017 and it works now in both 32-bit and 64-bit N++ 7.7.

              Like you, not sure if this the correct way to go, but for the little I used NppExport, it seems to work fine. Thanks!

              Ekopalypse 1 Reply Last reply Reply Quote 4
              • Ekopalypse
                Ekopalypse @Michael Vincent last edited by

                @Michael-Vincent

                for the time being that seems to be ok, maybe you wanna create a PR on @chcg fork so that this plugin gets updated.

                From my limited understanding the whole bits code can be ignored at all as a right shift 0 won’t do anything.

                	int bits = (int)SendMessage(hScintilla, SCI_GETSTYLEBITS, 0, 0);
                	unsigned char mask = 0xFF >> (8-bits);
                

                could become

                	unsigned char mask = 0xFF
                
                1 Reply Last reply Reply Quote 4
                • Michael Vincent
                  Michael Vincent last edited by

                  PR done

                  1 Reply Last reply Reply Quote 5
                  • guy038
                    guy038 last edited by

                    Hi, @michael-vincent,

                    I noticed :

                    • your pull request :

                    https://github.com/chcg/NPP_ExportPlugin/pull/8

                    • your changes, below :

                    https://github.com/chcg/NPP_ExportPlugin/pull/8/commits/4ea80cbc315f580fa4159aa05d928cc60de005e1

                    So, as I’m not a coder( and wonder if I should one day ! ), could you build / compile and propose a new Nppexport.dll file, directly usable ? Or, may be, there’s a link, that I’ve not noticed yet, on GitHub ?

                    Many thanks, by advance for your cooperation !

                    Best Regards,

                    guy038

                    1 Reply Last reply Reply Quote 0
                    • Michael Vincent
                      Michael Vincent last edited by

                      @guy038

                      Pre-release here

                      Please test and let me know how it goes. You’ll need to manually install.

                      Patrick Fulstone 1 Reply Last reply Reply Quote 2
                      • guy038
                        guy038 last edited by

                        Hello, @michael-vincent and All,

                        I shouldn’t expect your immediate reply ;-)) Again, many thanks for this fix !

                        So, I’ve just tested the x86 version, only, and all options are OK ! The highlighting of selected text is kept when pasted, for instance, in Word :-))

                        Cheers,

                        guy038

                        1 Reply Last reply Reply Quote 2
                        • Patrick Fulstone
                          Patrick Fulstone @Michael Vincent last edited by

                          @Michael-Vincent Can you re-share that pre-release?
                          The ‘Pre-release here’ link doesn’t seem to work.

                          1 Reply Last reply Reply Quote 0
                          • PeterJones
                            PeterJones last edited by guy038

                            @Patrick-Fulstone said:

                            Can you re-share that pre-release? The ‘Pre-release here’ link doesn’t seem to work.

                            Looks like the reason it doesn’t exist is because @chcg merged @Michael-Vincent’s pull request, and there is a new official / released tag for NppExport v0.2.9.21. You should be able to download the appropriate x86 or x64 zip, and install it over your existing NppExport, and hopefully that will work for you.

                            1 Reply Last reply Reply Quote 2
                            • Michael Vincent
                              Michael Vincent last edited by

                              @Patrick-Fulstone

                              Yes, @PeterJones is correct, I removed my forked repo after the pull request. This is the official version

                              Carl Witthoft 1 Reply Last reply Reply Quote 2
                              • Carl Witthoft
                                Carl Witthoft @Michael Vincent last edited by

                                @Michael-Vincent Version 0.30, 32-bit, does not work for me, Npp 7.7 on Windows 10 . However, updating to Npp7.8.1 does allow Nppexport to work. So no problem here, but other users may want to update.

                                1 Reply Last reply Reply Quote 2
                                • First post
                                  Last post
                                Copyright © 2014 NodeBB Forums | Contributors