Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Sort plugin available

2005-09-09
2012-11-14
  • Greg Bullock
    Greg Bullock
    2005-09-09

    You can download the source code and the DLL at:

    http://tsppd.com//SortPluginForNotePad++/Sort%20Plugin%20for%20NotePad++.zip

    A few possible problems:

    (1) The plugin may not handle all line-termination combinations correctly ([CR], [LF], and [CR][LF]).  I've only tested it with [CR][LF].

    (2) Multibyte and other coding schemes are not handled at present.

    I welcome help in fixing problems with the plugin.

    Regards.
    Greg

     
    • >I tried building it with Dev-C++ and with Code::Blocks ver. 1 rc2

      Don's PluginInterface.h file is barebones and it works with MS Visual Studio and not much else. All of my sources including NPPTextFX and today's update of your sort plugin all available on my page (see forum link above) have a substantially improved PluginInterface.h file which has been tested with all the compilers including MSVC Toolkit. All of the extern "C" and __cdecl stuff is forced by the .h file so you can't get through a compile if anything is wrong. A Borland C++ 5.51 Code::Blocks project is included.

      Again, my compile of your sort plugin is half the size of yours and without even testing I know it will work in Windows 98.

       
    • Josh Harris
      Josh Harris
      2005-09-10

      It doesn't work on my system with Notepad++ v3.2.  I get an error "the handle is invalid" when opening Notepad++ and than Notepad++ closes.  The NppPluginDemo uses
      BOOL APIENTRY DllMain( HANDLE hModule, DWORD  reasonForCall, LPVOID lpReserved)
      but you changed it to
      int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved).

      I changed it back to APIENTRY and compiled it with Visual Studio .Net and it works.  And is it supposed to sort capital letters before lower case?

      b
      B
      a
      A
      is sorted as
      A
      B
      a
      b

      Here's your dll that I changed to APIENTRY and recompiled:
      http://www.tateu.net/software/dl.php?f=SortPlugin_Mod

      And here's a sort plugin I wrote a few days ago:
      http://www.tateu.net/software/dl.php?f=NppSortLines

       
      • Greg Bullock
        Greg Bullock
        2005-09-11

        Thank you very much for the comments, Josh.

        Your sort plugin is very nice.  And it taught me a few things about using the Scintilla editor.  If I'd known about your plugin, I wouldn't have bothered.

        I've updated mine so the case-sensitive comparison is a user option, off by default.

        It seems the Borland C++Builder DLL template had the WINAPI declaration for the DllEntryPoint, and I hadn't noticed.  Thanks for catching that.

        Regards.
        Greg

         
        • Don HO
          Don HO
          2005-09-14

          Greg,

          > I've updated mine so the case-sensitive comparison is a user option, off by default.

          Where can I DL your new plugin (with the case-sensitive option)?

          Don

           
          • Greg Bullock
            Greg Bullock
            2005-09-15

            Hi, Don.

            The updated version replaced the original version.  You can download it at

            http://tsppd.com//SortPluginForNotePad++/Sort%20Plugin%20for%20NotePad++.zip

            Eventually I'll make some more improvements, e.g., to support multibyte chars.

            Regards.
            Greg

             
            • Larsene
              Larsene
              2005-10-14

              the sort plugin do not work :(
              when I put it (SortPlugin.dll) in the directory plugin
              and I try to start N++, a dialog box is open called "System err", and saying: "opration russi" which is french and seems operation succeeded.
              And when I click OK, nothing append.

              If I remove the dll file, N++ works again.

              What can I do?

               
              • Larsene
                Larsene
                2005-10-25

                Hi,

                Did I ask a wrong question, or why no one is answering me?

                 
                • Paulius
                  Paulius
                  2005-10-25

                  I think, development of this plugin stoped. So, i doubt you'll get your answer.

                  However, ther is another plugin wich supports sorting (but doesn't limit to just that) and is under active development - NPPTextFX.

                   
                  • Larsene
                    Larsene
                    2005-10-25

                    Thank you.

                    But could you tell me xhere I can download this plugin?
                    I do not find any url...

                    Thanks.

                     
              • Greg Bullock
                Greg Bullock
                2005-11-08

                I'm sorry.  I'm unable to reproduce this problem.

                All the same, I tried to fix it by building it with Dev-C++ and with Code::Blocks ver. 1 rc2 (using either Mingw, VC++, or BCC55), but in all cases I was unable to get a DLL working with NP++ for some reason.  Sometimes I got an error message
                  missing "setInfo" function
                and other times I got
                  "FuncItems" array is not set correctly

                The only version I could get to work with NotePad++ on my system is the version built with Borland C++Builder 6.0 (included with the download).  The project file is included, as well as a Borland-style make file.

                Regards.
                Greg

                 
    • The link above still downloads. For whatever reason, many plugins don't function in Windows 98. This one looks to be compiled in a new version of Borland Builder but doesn't include the project files. I updated the header files and built a Code::Blocks Borland C++ 5.51 project based on my current NPPTextFX project. My new compile cuts the executable size in half and it runs properly in Windows 98.

      Being in C++, it's big and not very fast but it works.

      My NPPTextFX plugin also offers sorting and works in Windows 98. Both plugins can be downloaded at the site in my announcement thread.

      http://sourceforge.net/forum/forum.php?thread_id=1352598&forum_id=482781

       
      • Greg Bullock
        Greg Bullock
        2005-11-08

        An updated version is available, with source code and the DLL, at:

        http://tsppd.com//SortPluginForNotePad++/Sort%20Plugin%20for%20NotePad++.zip

        The new version should be a little faster.

        Also, it gives an additional sorting option: Instead of comparing entire lines, you have the option of starting the comparison at the (character) column where the cursor sits (if there's no selection) or the column at the beginning of the selection.

        The project is built with Borland C++Builder 6.0.  I tried building it with Dev-C++ and with Code::Blocks ver. 1 rc2 (using Mingw, VC++, and BCC55), but in all cases I was unable to get a DLL working with NP++ for some reason.  Sometimes I got an error message
          missing "setInfo" function
        and other times I got
          "FuncItems" array is not set correctly

        The only version I could get to work with NotePad++ on my system is the BCB6 version included with the download.  The project file is included, as well as a Borland-style make file.

        Regards.
        Greg