Community
    • 登入

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

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

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

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

      1 條回覆 最後回覆 回覆 引用 0
      • EkopalypseE
        Ekopalypse
        最後由 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.

        Aliaksandr3byA 1 條回覆 最後回覆 回覆 引用 6
        • Aliaksandr3byA
          Aliaksandr3by @Ekopalypse
          最後由 編輯

          @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

          EkopalypseE Alan KilbornA 2 條回覆 最後回覆 回覆 引用 0
          • EkopalypseE
            Ekopalypse @Aliaksandr3by
            最後由 編輯

            @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 條回覆 最後回覆 回覆 引用 1
            • Alan KilbornA
              Alan Kilborn @Aliaksandr3by
              最後由 編輯

              @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 條回覆 最後回覆 回覆 引用 0
              • EkopalypseE
                Ekopalypse
                最後由 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 KilbornA 1 條回覆 最後回覆 回覆 引用 1
                • Alan KilbornA
                  Alan Kilborn @Ekopalypse
                  最後由 編輯

                  @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

                  EkopalypseE 1 條回覆 最後回覆 回覆 引用 1
                  • EkopalypseE
                    Ekopalypse @Alan Kilborn
                    最後由 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 條回覆 最後回覆 回覆 引用 1
                    • Alan KilbornA
                      Alan Kilborn
                      最後由 編輯

                      @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 條回覆 最後回覆 回覆 引用 2
                      • Alan KilbornA
                        Alan Kilborn
                        最後由 編輯

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

                        Imgur

                        1 條回覆 最後回覆 回覆 引用 0
                        • Alan KilbornA
                          Alan Kilborn
                          最後由 編輯

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

                          1 條回覆 最後回覆 回覆 引用 0
                          • pnedevP
                            pnedev
                            最後由 編輯

                            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 KilbornA 1 條回覆 最後回覆 回覆 引用 3
                            • Alan KilbornA
                              Alan Kilborn @pnedev
                              最後由 編輯

                              @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 條回覆 最後回覆 回覆 引用 2
                              • pnedevP
                                pnedev
                                最後由 編輯

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