Community

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

    Can I see a preview for the result of the "replace" form?

    Help wanted · · · – – – · · ·
    4
    14
    190
    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.
    • Aliaksandr3by
      Aliaksandr3by last edited by

      Can I see a preview for the result of the “replace” form?

      8f55cdf8-dcbd-4aa1-8cc5-729b9af0dead-image.png

      1 Reply Last reply Reply Quote 0
      • Ekopalypse
        Ekopalypse last edited by Ekopalypse

        @Aliaksandr3by

        I assume that you ask this regarding the RegexTrainer, correct?
        If so, I don’t see that it has such a feature. Maybe you can open
        a feature request here and the author of the plugin has the time to implement it.
        But there is one thing you have to consider.
        From what I see, this plugin uses dot.net and therefore I assume that it uses the regex engine of dot.net.
        Npp uses boost::regex, so it could be that the regex syntax is a bit different.

        Aliaksandr3by 1 Reply Last reply Reply Quote 6
        • Aliaksandr3by
          Aliaksandr3by @Ekopalypse last edited by

          @Ekopalypse

          no, i ask about the native feature of n++.
          I need to see a preliminary results of replace.

          5db0313a-5954-41fb-b3ce-64e1760a2db6-image.png

          Ekopalypse Alan Kilborn 2 Replies Last reply Reply Quote 0
          • Ekopalypse
            Ekopalypse @Aliaksandr3by last edited by

            @Aliaksandr3by

            No, unfortunately npp does not have a feature to get a preview for a replace operation.
            For an implementation I also see difficulties like

            • File size could cause problems
            • Files would have to be locked in order to guarantee the result
              …
            1 Reply Last reply Reply Quote 1
            • Alan Kilborn
              Alan Kilborn @Aliaksandr3by last edited by

              @Aliaksandr3by

              What version of Notepad++ has a Find All in Current Document on the Replace tab ??

              I was going to elaborate on an idea to use the Compare plugin as a solution to the original query, but I looked at the plugin’s website ( apparently https://github.com/jsleroy/compare-plugin ) and the most-recent change is 3.5 years or so ago.

              I’m sure there has to be more-recent changes to this plugin?
              Anyone know?

              1 Reply Last reply Reply Quote 0
              • Ekopalypse
                Ekopalypse last edited by Ekopalypse

                I think the that the picture is a mock up.
                Install compare from plugin manager then you get the most current/actual version provided by @pnedev. Here is his repo.

                Alan Kilborn 1 Reply Last reply Reply Quote 1
                • Alan Kilborn
                  Alan Kilborn @Ekopalypse last edited by

                  @Ekopalypse said in Can I see a preview for the result of the "replace" form?:

                  I think the that the picture is a mock up.

                  Then, a confusing mock up! :-)

                  Install compare from plugin manager

                  Of course you mean Plugins Admin

                  But yes…
                  Usually when I’m looking at a new plugin to install, or to give advice concerning a plugin, I’ll first go to check out latest developments on that plugin.

                  I was surprised to see the site listed in Plugins Admin for the Compare plugin was one that had 3.5 year old code, and is different from the one you provided:

                  https://github.com/jsleroy/compare-plugin

                  Ekopalypse 1 Reply Last reply Reply Quote 1
                  • Ekopalypse
                    Ekopalypse @Alan Kilborn last edited by Ekopalypse

                    @Alan-Kilborn

                    Yes , of course admin :-D

                    Never noticed that the homepage listed in the plugin description is the old one. @pnedev - something you want to change??

                    EDIT: The about page contains both.

                    1 Reply Last reply Reply Quote 1
                    • Alan Kilborn
                      Alan Kilborn last edited by

                      @Aliaksandr3by

                      This may work for your original query:

                      • get the Compare plugin
                      • when you want to do this type of preview, first save your file
                      • do your replacement operation (Replace All is probably most effective for this “demo”)
                      • run Plugins > Compare > Diff since last Save

                      This will give you a “preview” of your replacement action.
                      If you don’t like what was replaced, simply Undo the replacement.

                      1 Reply Last reply Reply Quote 2
                      • Alan Kilborn
                        Alan Kilborn last edited by

                        Here’s an example of what such a “preview” could look like:

                        Imgur

                        1 Reply Last reply Reply Quote 0
                        • Alan Kilborn
                          Alan Kilborn last edited by

                          It looks like this POSTING is where I “stole” this idea from. Cred where cred is due.

                          1 Reply Last reply Reply Quote 0
                          • pnedev
                            pnedev last edited by

                            Hi @Ekopalypse ,

                            Never noticed that the homepage listed in the plugin description is the old one. @pnedev - something you want to change??

                            I started working on Compare as a contributor because I wanted to fix its long-standing instabilities. When I released v2.0 I kept the original plugin project page link - it is the official home of Compare plugin anyway. Sadly, no one maintains it anymore.

                            I separated my own clone of the project and started working on a new compare plugin with many new features. It is based on the original Compare but actually differs a lot. I didn’t want to mess the original plugin further but leave its fate to its authors. This way the users could use it as it is now if they prefer it over the new plugin I’m working on.

                            So yes, https://github.com/pnedev/compare-plugin is the source of the latest Compare v2.0 because I supported it but Compare plugin’s official project page is still https://github.com/jsleroy/compare-plugin. I am not supporting Compare anymore.
                            https://github.com/pnedev/compare-plugin is the home of the new compare plugin I’m working on. It is not released yet.

                            Hi @Alan-Kilborn ,

                            If you don’t like what was replaced, simply Undo the replacement.

                            Unfortunatelly Compare plugin (v2.0 and all prior versions) clears the Undo history due to its internal alignment implementation. Do not rely on Undo after compare with Compare plugin.
                            In the steps you mention (if the file is not saved) the user will need to reload the file from disk to get the state before the replacement.

                            BR

                            Alan Kilborn 1 Reply Last reply Reply Quote 3
                            • Alan Kilborn
                              Alan Kilborn @pnedev last edited by

                              @pnedev said in Can I see a preview for the result of the "replace" form?:

                              Unfortunatelly Compare plugin (v2.0 and all prior versions) clears the Undo history due to its internal alignment implementation. Do not rely on Undo after compare with Compare plugin.
                              In the steps you mention (if the file is not saved) the user will need to reload the file from disk to get the state before the replacement.

                              Ah, I did not know that.
                              It makes the technique a little less useful, but it still has value.

                              Isn’t there another way for the plugin to do what it needs to without messing with the undo history?

                              If you release your version of the plugin, maybe give it a slightly different name to prevent confusion.

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

                                @Alan-Kilborn said in Can I see a preview for the result of the "replace" form?:

                                Isn’t there another way for the plugin to do what it needs to without messing with the undo history?
                                If you release your version of the plugin, maybe give it a slightly different name to prevent confusion.

                                Unfortunately Compare plugin cannot circumvent the Undo history clean-up.

                                The new plugin will be called ComparePlus, it has completely new alignment approach and keeps the Undo intact.
                                It is almost finished but sadly that’s its state for about 8 months now. I’m not sure when exactly it will be ready.

                                BR

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