With the "replace all" button, replace everything in truth.
-
@Claudia-Frank said:
Replace works in the direction of your <<find or find>> usage
Yes, but there’s a problem with this new interface, in my opinion. Before 7.4.2, where I could see UP or DOWN selected, I had great (at least 100%!) confidence that my
Replace-All
would be in my intended direction. With the 7.4.2 changes to the Find UI, I can no longer be so certain. Notepad++ remembers what I last used for Direction, but I don’t. :-DSo I find myself putting the caret in a “strategic” spot in relation to the replace I want to do, then doing a
Find <<
or aFind >>
to jump to my first desired replacement, THEN doing theReplace-All
. It’s “okay”, but it IS sort of an interruption to my desired workflow.As previously mentioned, the Wrap option makes direction pointless, but I frequently want to replace from the caret to one end of the file or the other, so I don’t want wrapping enabled.
-
As previously mentioned, the Wrap option makes direction pointless, but I frequently want to replace from the caret to one end of the file or the other, so I don’t want wrapping enabled.
Scott, I guess I’m missing here something.
I mean, if you do not want to replace all within the whole document and start searching
other than from the top, uncheck wrap around, but in case you want to have it but still don’t
want to switch back to the top, check it. For me it is just another alternative.
What do I miss?Cheers
Claudia -
Maybe it is a small point; maybe it just bugs me alone. But to clarify (hopefully), try the following sequence on the text below once you put it in a new editor window:
-
Wrap around
: unchecked -
Put caret at end-of-file.
-
Do a
Find <<
ond
twice. -
…time passes…you do something else…phone rings…your mind is wiped…then you come back to Notepad++…
-
Now you want to change all
a
from caret point to end-of-file toA
. -
Put
a
inFind what
. PutA
inReplace with
. -
Press
Replace All
…but you have no idea (and no way of knowing) which direction from the caret it will be done (remember, your mind was wiped, by your phone call or whatever). Before the 7.4.2 user interface, you could glance at the Direction box and see if it was set toUp
orDown
. In this case you will get all thea
characters replaced from the caret point to top-of-file, which is NOT what was intended, but sinceFind <<
was used more recently thanFind >>
, that is what you get.The
licenses
for
most
softwAre
Are
designed
to
take
away
your
freedom
to
share
and
change
it.
-
-
:-) 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 likeif (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 -
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”. :-)
-
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 -
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.
-
@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!
-
@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.
-
@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…
-
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.
-
@alan-kilborn @PeterJones Are either of you UI designers? Or at least designers for this application?
-
@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: