Community
    • Login

    With the "replace all" button, replace everything in truth.

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    17 Posts 9 Posters 7.0k Views
    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.
    • Claudia FrankC
      Claudia Frank @Scott Sumner
      last edited by

      @Scott-Sumner

      :-) this is clear it was about

      As previously mentioned, the Wrap option makes direction pointless,

      btw. how can I remember that my brain was wiped if it was wiped??
      I mean, my brain hasn’t a function like

      if (nothing_in_brain())
      {
          brain_has_wiped = True;
      }
      

      my brain has a function like

      if (nothing_in_brain())
      {
          go_and_take_another_coffee_nothing_to_do_at_the_moment();
      }
      

      :-D

      Cheers
      Claudia

      Alan KilbornA 1 Reply Last reply Reply Quote 1
      • Alan KilbornA
        Alan Kilborn @Claudia Frank
        last edited by

        @Claudia-Frank

        Could it be that @Scott-Sumner, when saying that “wrap makes direction pointless” is meaning that when Replace-All is being used, in conjunction with the wrap checkbox being checked, it doesn’t matter which direction the search+replace goes, the effect is the same?

        In this situation, all occurrences of the find text are replaced with the replace text for the entire document (regardless of direction). I can’t think of a scenario where this isn’t true for a normal mode search (and it doesn’t apply to regex searches because they are only in the down direction).

        Heck, maybe even internally when N++ sees this situation (Replace All in upwards direction), it converts it to Replace All in downwards direction, because code-wise I would think that is simpler to handle (string matching functions work better from a starting point to a point further in the string–think a regex engine and lookaheads–easier than lookbehinds). Okay, okay, that theory about N++ internals may be a bit “out there”. :-)

        Claudia FrankC 1 Reply Last reply Reply Quote 2
        • Claudia FrankC
          Claudia Frank @Alan Kilborn
          last edited by

          @Alan-Kilborn

          Could it be that @Scott-Sumner, when saying that “wrap makes direction pointless”…

          I guess so but maybe I misunderstand the meaning of the word pointless here.
          I would translate it to the german word sinnlos which means it makes no sense.
          But I can’t argue that a parameter (wrap around) used by a function (replace all) makes
          direction parameter pointless, can I? I mean, yes, if you use wrap around together with
          replace all the direction previously used doesn’t matter - everything gets replaced.

          Now while typing this I start to understand, I think, it means, in this situation, the direction
          doesn’t matter.

          Sometimes it just takes a bit longer (only days) to get my brain into gear.

          Thanks for clarification :-D

          Cheers
          Claudia

          1 Reply Last reply Reply Quote 1
          • zylstraZ
            zylstra
            last edited by

            I see now that I can use Replace as I would expect it to function if I check the Wrap around option box. But I think the UI is lacking in this instance. The Replace feature should replace all instances by default with nothing checked. From there consider if adding an option for replacing forward or backward is needed.

            My experience was that I found that Replace replaced only forward from my cursor. I was confused, so I searched the interface for an option to “replace all”, which I did not find. I thought that In selection might have something to do with it; it would work if I selected everything, but it is still kludgy.

            So I checked Backward direction and clicked Replace All. It worked! I fixed it …Or so I thought …Until I attempted to replace something in another document. This time only the upper portion of the document was replaced. Sooo, I had to uncheck the Backward direction box and click Replace all again.

            But, I thought, this certainly can’t be the way this was designed to work. So here I find myself …searching the web …and finally just wishing the UI was better designed.

            PeterJonesP Lycan ThropeL Alan KilbornA 3 Replies Last reply Reply Quote 0
            • PeterJonesP
              PeterJones @zylstra
              last edited by PeterJones

              @zylstra ,

              I see now that I can use Replace as I would expect it to function if I check the Wrap around option box. But I think the UI is lacking in this instance. The Replace feature should replace all instances by default with nothing checked.

              Out of the box, Notepad++ ships with that checkbox checked (so Wrap Around is enabled by default). Thus, the behavior you want as the default is the default behavior. Complaining because the checkbox was worded in such a way that the default behavior required a checkmark that was already there seems pointless to me.

              I find myself …searching the web

              In the future, I suggest you go to the ? menu in Notepad++, which is in the position nearly-universally used for the “Help” menus in Windows programs, which contains useful links like “Notepad++ Online User Manual” which takes you to the online User Manual (which includes the “Searching” page, with a description of how to use the various options on the Find or Replace or similar tabs), or the “Notepad++ Community (Forum)” which would have taken you here without searching.

              But, I thought, this certainly can’t be the way this was designed to work

              And in fact, it was designed to work with Wrap Around enabled by default, exactly as you desired. Yay!

              1 Reply Last reply Reply Quote 1
              • Lycan ThropeL
                Lycan Thrope @zylstra
                last edited by

                @zylstra ,

                Besides what Peter has mentioned, I unchecked it because I don’t like the search continuing back around because sometimes changing things changes other things and the second time around might mistake one pattern for another, BUT, I also put my cursor at the beginning of a document so that it can search from top to bottom, and when done, doesn’t wrap around it just says it can’t find any more. That’s what I’m used to, so you may not like going to the top of the document, like I do, in which case, leaving the Wrap Around checked will accomplish what you want after starting in the middle of a document.

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

                  @zylstra said in With the "replace all" button, replace everything in truth.:

                  But, I thought, this certainly can’t be the way this was designed to work.

                  I think you’re “off base” in most if not all of your statements.

                  wishing the UI was better designed

                  This can be said of any UI ever created. (So you’re accurate in that statement).

                  The Replace feature should replace all instances by default with nothing checked

                  No, that’s what Replace All is for. And even, as you’ve noticed Replace All has qualifiers (aka options).

                  My experience was that I found that Replace replaced only forward from my cursor.

                  Expected behavior in any text editor ever made.

                  so I searched the interface for an option to “replace all”, which I did not find.

                  Really?? It’s right there. A bit fat button that says Replace All on it. (But you do know that because you discuss it later in your post).

                  So I checked Backward direction and clicked Replace All. It worked! I fixed it …Or so I thought …Until I attempted to replace something in another document. This time only the upper portion of the document was replaced.

                  Totally expected behavior. You are telling it to replace upwards.

                  In summary: Really? Is your posting a joke? It’s (the UI) not bad, and it isn’t hard to understand…

                  1 Reply Last reply Reply Quote 0
                  • Alan KilbornA
                    Alan Kilborn @Lycan Thrope
                    last edited by Alan Kilborn

                    @lycan-thrope

                    I unchecked it because I don’t like the search continuing back around because sometimes changing things changes other things and the second time around might mistake…

                    You are notified when the wrap around happens…

                    General thought for this thread: I think 2 very different behaviors (Replace and Replace All) are being discussed as if they are closely related; they, and their options are somewhat different.

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

                      @alan-kilborn @PeterJones Are either of you UI designers? Or at least designers for this application?

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

                        @zylstra said in With the "replace all" button, replace everything in truth.:

                        Are either of you UI designers? Or at least designers for this application?

                        I’m an old-timer here on this site, so I know where this is going…
                        It comes up occasionally.
                        Everyone thinks they have the best idea for how this UI should be designed.
                        And everyone proposing changes gets shot down, because there is no “best idea”.
                        So if you want to continue complaining about this UI, go ahead, but I guarantee that it is pointless and no one will care about your complaints.

                        The answer is to learn how to use the software – it isn’t that difficult. Some of your initial statements show that you have no clue about a traditional text editor’s search and replace functions and the basic workings that have been in place for decades.

                        Tangentially related: Perhaps you will like (i.e., find amusement in) these issues:

                        • Find - Replace dialog enhancement and simplification
                        • Enhancement of the Search and Replace dialog (S&RD) in N++ and related tools: descriptive Help and new Features explained
                        1 Reply Last reply Reply Quote 5
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors