"Replace all" finds in already replaced text

Report Bugs Here

"Replace all" finds in already replaced text

Postby fberger » Mon Sep 20, 2010 4:56 pm

When replacing text with multiple copies of itself, Editra wraps the find/replace and restarts with the just replaced text, leading to unwanted replacements.

Example:

1. Enter

Code: Select all
eggs
eggs
eggs


2. Find: "eggs", Replace: "eggs-eggs"
3. Hit [Find]
4. Hit [Find and Replace]
5. Hit [Replace all]

Actual behaviour: Editra re-replaces the just added "eggs" in the first line.

Expected behaviour: Upon [Replace all], Editra should only consider occurences that have not been replaced yet.

Editra version: 0.5.72

Thanks for considering,
Florian
fberger
User
 
Posts: 27
Joined: Mon Jul 05, 2010 9:53 am
Location: Germany

Re: "Replace all" finds in already replaced text

Postby cody » Mon Sep 20, 2010 5:46 pm

Hi,

I don't think this is an issue. Replace All will do what it says and replace all occurrences in the document.

There is no way to know the context of what was just done, you could have for example done the find->replace, then edited the document some then went back and hit replace all. At that point would you still expect it to only replace words that haven't already been replaced by your previous find->replace action?

The text may have moved or been modified in some other way by then so this is not something that would be expected. I will leave it in consideration but unless there are others that feel the same way I have no intention of changing the current behavior.


Cody
User avatar
cody
Site Admin
 
Posts: 1315
Joined: Mon Oct 09, 2006 2:49 am
Location: United States

Re: "Replace all" finds in already replaced text

Postby fberger » Mon Oct 11, 2010 10:54 pm

Hi cody,

thanks for your reply.

Well, I am a nano convert, I think that may explain my issue.

In nano, you hit [Meta]+[r] to enter find-replace-mode. nano asks for search an replace string and subsequently offers four options:

    - replace found occurence
    - find next occurence
    - replace all follwing occurences
    - cancel find-replace-mode

This is just to explain what I'm used to. So, when working in Editra, I open the Find/Replace dialog, assuming to enter "find-replace-mode". I understand now that Editra has no such "mode" and hence can not know what not to replace. But since my behaviour pattern quite often is "replace first by hand, replace second by hand... naah, that looks good, let's replace all remaining automatically", I would appreciate if Editra could support that.

One possibility would be that "Replace All" replaces from the current cursor position (EDIT: with the cursor following the occurences) and then asks before wrapping to the start of the document. This could also be an option: "[ ] ask before wrapping to start of file", or so.

Thanks for considering,
fberger
fberger
User
 
Posts: 27
Joined: Mon Jul 05, 2010 9:53 am
Location: Germany

Re: "Replace all" finds in already replaced text

Postby TheoJ » Tue Sep 23, 2014 12:28 pm

One thing I've noticed with the replace all function is that when I want to replace all with a capital letter at the front it ignores it and replaces everything whether it has a capital letter or not.

How do I make it exact match for capital letters?
TheoJ
 

Re: "Replace all" finds in already replaced text

Postby cody » Tue Sep 23, 2014 1:49 pm

This post is 4 years old should have opened new topic.

Anyway select the "Match Case" option the find replace dialog if you want it to be case sensitive.
User avatar
cody
Site Admin
 
Posts: 1315
Joined: Mon Oct 09, 2006 2:49 am
Location: United States


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest

cron