Community
    • 登入

    Plugins -> NppExport lost color format in version 7.7.7

    已排程 已置頂 已鎖定 已移動 Help wanted · · · – – – · · ·
    14 貼文 9 Posters 4.4k 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • gerdb42G
      gerdb42
      最後由 編輯

      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 條回覆 最後回覆 回覆 引用 4
      • Michael VincentM
        Michael Vincent
        最後由 編輯

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

        EkopalypseE 1 條回覆 最後回覆 回覆 引用 4
        • EkopalypseE
          Ekopalypse @Michael Vincent
          最後由 編輯

          @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 條回覆 最後回覆 回覆 引用 4
          • Michael VincentM
            Michael Vincent
            最後由 編輯

            PR done

            1 條回覆 最後回覆 回覆 引用 5
            • guy038G
              guy038
              最後由 編輯

              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 條回覆 最後回覆 回覆 引用 0
              • Michael VincentM
                Michael Vincent
                最後由 編輯

                @guy038

                Pre-release here

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

                Patrick FulstoneP 1 條回覆 最後回覆 回覆 引用 2
                • guy038G
                  guy038
                  最後由 編輯

                  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 條回覆 最後回覆 回覆 引用 2
                  • Patrick FulstoneP
                    Patrick Fulstone @Michael Vincent
                    最後由 編輯

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

                    1 條回覆 最後回覆 回覆 引用 0
                    • PeterJonesP
                      PeterJones
                      最後由 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 條回覆 最後回覆 回覆 引用 2
                      • Michael VincentM
                        Michael Vincent
                        最後由 編輯

                        @Patrick-Fulstone

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

                        Carl WitthoftC 1 條回覆 最後回覆 回覆 引用 2
                        • Carl WitthoftC
                          Carl Witthoft @Michael Vincent
                          最後由 編輯

                          @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 條回覆 最後回覆 回覆 引用 2
                          • 第一個貼文
                            最後的貼文
                          The Community of users of the Notepad++ text editor.
                          Powered by NodeBB | Contributors