Menu

#627 [NEW FEATURE / ENHANCEMENT] Show progress window during FindInFiles and ReplaceInFiles

Next_release
closed
nobody
None
7
2015-03-12
2014-11-09
Pavel Nedev
No

Hi,
This patch adds progress tracking during FindInFiles and ReplaceInFiles operations. It shows progress bar window with cancel button instead of the cancel MessageBox that pops-up now.
This also removes the potential problems that may arise from terminating the cancel MessageBox thread mentioned above. My experience is that Notepad++ sometimes crashes during FindInFiles and ReplaceInFiles operations. I'm not absolutely sure but I think the thread termination might be causing the crash. If I'm right then the patch fixes this issue as well.

My Notepad++ is configured to automatically remove all trailing white spaces on file save so the patch includes a bunch of line changes that are simply white space removals. Sorry if that causes confusion.

1 Attachments

Related

Patches: #627

Discussion

  • Pavel Nedev

    Pavel Nedev - 2014-11-11

    Please use FindInFilesProgress_v2.patch attached with this post instead of FindInFilesProgress.patch. I removed one unnecessary message handling from the window procedure.

     
    • Christophe Meriaux

      Hello Pavel,
      very nice feature. Thank you.

      About your "remove all trailing white spaces" added in your patch, I have
      another solution for you :

      • unmap the shortcup CTRL+S of save function
      • create a macro that call "Trim Trailling Space" function and "save"
        function
      • map this macro the CTRL+S shortcut

      Here is my macro (shortcuts.xml) :

      <macro name="Trim Trailing and save" ctrl="yes" alt="no" shift="no" key="83">
      <action type="2" message="0" wparam="42024" lparam="0" sparam="">
      <action type="2" message="0" wparam="41006" lparam="0" sparam="">
      </action></action></macro>

      Christophe

      2014-11-11 10:33 GMT+01:00 Pavel Nedev pnedev@users.sf.net:

      Please use FindInFilesProgress_v2.patch attached with this post instead of
      FindInFilesProgress.patch. I removed one unnecessary message handling from
      the window procedure.

      Attachment: FindInFilesProgress_v2.patch (60.9 kB; text/x-patch)

      Status: open
      Group: Next_release
      Created: Sun Nov 09, 2014 11:21 PM UTC by Pavel Nedev
      Last Updated: Sun Nov 09, 2014 11:21 PM UTC
      Owner: nobody

      Hi,
      This patch adds progress tracking during FindInFiles and ReplaceInFiles
      operations. It shows progress bar window with cancel button instead of the
      cancel MessageBox that pops-up now.
      This also removes the potential problems that may arise from terminating
      the cancel MessageBox thread mentioned above. My experience is that
      Notepad++ sometimes crashes during FindInFiles and ReplaceInFiles
      operations. I'm not absolutely sure but I think the thread termination
      might be causing the crash. If I'm right then the patch fixes this issue as
      well.

      My Notepad++ is configured to automatically remove all trailing white
      spaces on file save so the patch includes a bunch of line changes that are
      simply white space removals. Sorry if that causes confusion.


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/notepad-plus/patches/627/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Patches: #627

      • Christophe Meriaux

        Hello again,
        after looking your patch, I figure out my mistake. I though you add code to
        modify the function "save" to add a trim trailing space.
        I didn't understood you removed the trailing space in the C++ code.

        My opinion is you were right to clean file. Maybe we should make a total
        cleaning of every file.

        Christophe

        2014-11-14 10:56 GMT+01:00 Christophe Meriaux christophe.meriaux@gmail.com
        :

        Hello Pavel,
        very nice feature. Thank you.

        About your "remove all trailing white spaces" added in your patch, I have
        another solution for you :

        • unmap the shortcup CTRL+S of save function
        • create a macro that call "Trim Trailling Space" function and "save"
          function
        • map this macro the CTRL+S shortcut

        Here is my macro (shortcuts.xml) :

        <macro name="Trim Trailing and save" ctrl="yes" alt="no" shift="no" key="83">
        <action type="2" message="0" wparam="42024" lparam="0" sparam="">
        <action type="2" message="0" wparam="41006" lparam="0" sparam="">
        </action></action></macro>

        Christophe

        2014-11-11 10:33 GMT+01:00 Pavel Nedev pnedev@users.sf.net:

        Please use FindInFilesProgress_v2.patch attached with this post instead
        of FindInFilesProgress.patch. I removed one unnecessary message handling
        from the window procedure.

        Attachment: FindInFilesProgress_v2.patch (60.9 kB; text/x-patch)

        Status: open
        Group: Next_release
        Created: Sun Nov 09, 2014 11:21 PM UTC by Pavel Nedev
        Last Updated: Sun Nov 09, 2014 11:21 PM UTC
        Owner: nobody

        Hi,
        This patch adds progress tracking during FindInFiles and ReplaceInFiles
        operations. It shows progress bar window with cancel button instead of the
        cancel MessageBox that pops-up now.
        This also removes the potential problems that may arise from terminating
        the cancel MessageBox thread mentioned above. My experience is that
        Notepad++ sometimes crashes during FindInFiles and ReplaceInFiles
        operations. I'm not absolutely sure but I think the thread termination
        might be causing the crash. If I'm right then the patch fixes this issue as
        well.

        My Notepad++ is configured to automatically remove all trailing white
        spaces on file save so the patch includes a bunch of line changes that are
        simply white space removals. Sorry if that causes confusion.


        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/notepad-plus/patches/627/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/

         

        Related

        Patches: #627

        • Pavel Nedev

          Pavel Nedev - 2014-11-14

          Hi Christophe, I'm glad you like it.

          Perhaps I should make the Progress window top-most always so the user cannot hide it or at least create it with WS_EX_TOOLWINDOW style to hide it from task bar and Alt-Tab switcher.
          Unfortunately I cannot check these changes right now because I'm working under Linux and I don't have a way to compile N++ at the moment.

          You can find attached the untested FindInFilesProgress_v3.patch.
          It also uses global scoping for the system API functions to be consistent with N++ code style.
          I'll test the new version tonight.

           
          • Pavel Nedev

            Pavel Nedev - 2014-11-15

            Hi again,
            You can find the tested version 3 of the patch in the post below.
            I have deleted the untested attachment from here.

             
  • Pavel Nedev

    Pavel Nedev - 2014-11-15

    This is the last tested update of the patch: FindInFilesProgress_v3.patch

    As I wrote to Christophe, I have made Win32 API function calls globally scoped (to be consistent with N++ code style) + the Progress window now has the WS_EX_TOOLWINDOW + WS_EX_TOPMOST styles to hide it from task-bar and Alt-Tab switcher while active and keep it always on top of other windows. It is also re-based to the latest SVN revision.

     
    • Christophe Meriaux

      Hy Pavel,
      I compiled your patch and tried it. I applied your patch on revision 1288
      Your feature is awesome. I Hope Don will integrate it.
      Christophe

       
      • Pavel Nedev

        Pavel Nedev - 2014-11-18

        Thanks Christophe.

         
  • Don HO

    Don HO - 2014-11-26

    The "remove all trailing white spaces" makes patch review impossible.
    Is it possible to do without this part?

    Don

     

    Last edit: Don HO 2014-11-26
    • Pavel Nedev

      Pavel Nedev - 2014-11-26

      Sure.
      Here is patch version 4:
      1) No trailing white-space removals.
      2) re-based on latest SVN revision.

      BR,
      Pavel

       
      • Don HO

        Don HO - 2014-11-28

        Thank you Pavel for the v4 patch.

        I integrated your patch and compiled Notepad++ with VS2013. The binary crashed under Win 8.1 64 bits and 32 bits machines (in the end of search). Of course, the binary without integration of this patch doesn't crash with the same condition.

        Please see the attached files to reproduce the crash.
        You can download the compiled binary here:
        http://notepad-plus-plus.org/tmp/notepad++_newFindProgressDialog.7z

        Don

         

        Last edit: Don HO 2014-11-28
        • Pavel Nedev

          Pavel Nedev - 2014-11-28

          Hi Don,

          I do not have Win 8.1 machine so I cannot test on Win 8.1.
          I tested your binary on XP (Wine on Linux actually - XP mode) and it also
          crashed as you said.
          I'll take a look.

          Meanwhile, can you test with the attached binary and write back if it works
          ok?
          I've compiled it with VS2012 on Win 7 64bit, N++ src rev.1296.

          I have renamed the attached zip from notepad++.7z to notepad++.arch to be
          able to pass gmail attachment filters.
          Rename it back once downloaded.

          Thanks,
          Pavel

          On Fri, Nov 28, 2014 at 3:08 AM, Don HO donho@users.sf.net wrote:

          Thank you Pavel for the v4 patch.

          I integrated your patch and compiled Notepad++ with VS2013. The binary
          crashed under Win 8.1 64 bits and 32 bits machines (in the end of search).

          Please see the attached files to reproduce the crash.
          You can download the compiled binary here:
          http://notepad-plus-plus.org/tmp/notepad++_newFindProgressDialog.7z

          Don

          Status: open
          Group: Next_release
          Created: Sun Nov 09, 2014 11:21 PM UTC by Pavel Nedev
          Last Updated: Wed Nov 26, 2014 01:33 AM UTC
          Owner: nobody

          Hi,
          This patch adds progress tracking during FindInFiles and ReplaceInFiles
          operations. It shows progress bar window with cancel button instead of the
          cancel MessageBox that pops-up now.
          This also removes the potential problems that may arise from terminating
          the cancel MessageBox thread mentioned above. My experience is that
          Notepad++ sometimes crashes during FindInFiles and ReplaceInFiles
          operations. I'm not absolutely sure but I think the thread termination
          might be causing the crash. If I'm right then the patch fixes this issue as
          well.

          My Notepad++ is configured to automatically remove all trailing white
          spaces on file save so the patch includes a bunch of line changes that are
          simply white space removals. Sorry if that causes confusion.


          Sent from sourceforge.net because you indicated interest in
          https://sourceforge.net/p/notepad-plus/patches/627/

          To unsubscribe from further messages, please visit
          https://sourceforge.net/auth/subscriptions/

           

          Related

          Patches: #627

          • Don HO

            Don HO - 2014-11-29

            Hi Pavel,

            Tested notepad++.arch, it doesn't crash anymore.
            I guess it OK to go. Could you provide your new patch then?
            Thank you for your quick fix.

            Don

             
  • Pavel Nedev

    Pavel Nedev - 2014-11-29

    Hi Don,

    That's strange. I haven't changed anything in the code.
    Just tried compiling N++ in Unicode Debug configuration and the binary crashed as you observed. Compiling Unicode Release configuration works fine (notepad++.arch was build in release mode).
    I have no idea what's the reason yet, need to investigate further.

    Can you try building N++ in Unicode Release and test if it is OK?

    BR,
    Pavel

     
    • Don HO

      Don HO - 2014-11-30

      Pavel,

      I built the binary (with your patch) in Unicode Release mode. There's no crash.
      But I cannot integrate your patch since there's some crash issues in debug mode (it crash even when I click on Cancel button).

      Don

       

      Last edit: Don HO 2014-11-30
      • Pavel Nedev

        Pavel Nedev - 2014-12-01

        I know Don, I'll look into that, thanks.

        Pavel

         
  • Anonymous

    Anonymous - 2014-12-10

    Hi Pavel/Don,
    When I used notepad++.arch, found strange behavior of Compare plugin.
    After clicking on "Plugins->Compare->Compare (Alt+D)", file matches with itself and hence showing "Files Match" dialogue.

     
    • Pavel Nedev

      Pavel Nedev - 2014-12-10

      Hi,
      This doesn't seem related to this patch as it only changes the dialog shown on FindInFiles and ReplaceInFiles operations. However notepad++.arch was built on re-based N++ source code (unpublished yet) so it might have something to do with this issue.
      Can you try N++ RC 6.7 version (announced by Don couple of days ago - look on the Discussion forum) and check if the issue is there?
      Write back the result.

       
      • Anonymous

        Anonymous - 2014-12-10

        I tried N++ RC 6.7 and found that issue is in Release Candidate 6.7 version.
        This has nothing to do with your patch.

        Thanks for your patch.
        I'm going to post this issue in appropriate forum.

         
  • Pavel Nedev

    Pavel Nedev - 2015-01-16

    Hi Don,

    Here is v5 of the patch. It is working in both Debug and Release mode. Rebased on latest SVN commit. Sorry for the late update.

    Pavel

     
  • Pavel Nedev

    Pavel Nedev - 2015-02-02

    Please use this final patch-set (v6 attached).
    I have used GetWindowLongPtr() everywhere instead of GetWindowLong(). This doesn't change anything functionally if the binary is 32-bit but is recommended if in the future 64-bit is considered.

     
  • Don HO

    Don HO - 2015-02-19

    Thank you Pavel.
    There's no crash anymore with your latest patch.
    I added some enhancement as well.
    Committed in rev. 1345.

    Thank you for your contribution.

    Don

     
    • Pavel Nedev

      Pavel Nedev - 2015-02-22

      Thank you for Notepad++, Don.

      Your enhancement is great but it will show the current file only when the percent is increased. Now because the percent is increased by minimum 1% if there are many files in the search then 1% may contain several files. Now only the last will be shown.
      The patch with this post will update the info you added on every file searched.

      Pavel

       
  • Don HO

    Don HO - 2015-02-19
    • status: open --> accepted
    • Priority: 5 --> 7
     
  • Don HO

    Don HO - 2015-03-12
    • Status: accepted --> closed
     
MongoDB Logo MongoDB