• Login
Community
  • Login

Plugins -> NppExport lost color format in version 7.7.7

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
14 Posts 9 Posters 3.5k 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.
  • M
    musashiharuno
    last edited by Jun 13, 2019, 6:54 AM

    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.
    M 1 Reply Last reply Jun 13, 2019, 7:03 AM Reply Quote 0
    • M
      Meta Chuh moderator @musashiharuno
      last edited by Meta Chuh Jun 13, 2019, 12:09 PM Jun 13, 2019, 7:03 AM

      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
      • M
        musashiharuno
        last edited by Jun 13, 2019, 12:07 PM

        I see, thanks for your info @Meta-Chuh

        1 Reply Last reply Reply Quote 1
        • G
          gerdb42
          last edited by Jun 14, 2019, 1:34 PM

          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
          • M
            Michael Vincent
            last edited by Jun 14, 2019, 3:58 PM

            @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!

            E 1 Reply Last reply Jun 14, 2019, 4:37 PM Reply Quote 4
            • E
              Ekopalypse @Michael Vincent
              last edited by Jun 14, 2019, 4:37 PM

              @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
              • M
                Michael Vincent
                last edited by Jun 14, 2019, 6:53 PM

                PR done

                1 Reply Last reply Reply Quote 5
                • G
                  guy038
                  last edited by Jun 19, 2019, 1:12 AM

                  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
                  • M
                    Michael Vincent
                    last edited by Jun 19, 2019, 1:45 AM

                    @guy038

                    Pre-release here

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

                    P 1 Reply Last reply Aug 12, 2019, 6:27 PM Reply Quote 2
                    • G
                      guy038
                      last edited by Jun 19, 2019, 2:19 AM

                      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
                      • P
                        Patrick Fulstone @Michael Vincent
                        last edited by Aug 12, 2019, 6:27 PM

                        @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
                        • P
                          PeterJones
                          last edited by guy038 Aug 13, 2019, 6:28 PM Aug 12, 2019, 7:02 PM

                          @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
                          • M
                            Michael Vincent
                            last edited by Aug 12, 2019, 7:21 PM

                            @Patrick-Fulstone

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

                            Carl WitthoftC 1 Reply Last reply Nov 13, 2019, 4:47 PM Reply Quote 2
                            • Carl WitthoftC
                              Carl Witthoft @Michael Vincent
                              last edited by Nov 13, 2019, 4:47 PM

                              @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
                              The Community of users of the Notepad++ text editor.
                              Powered by NodeBB | Contributors