Bug 138285 - FIND AND REPLACE DIALOG: Allow users to see the replace result before moving to the next search
Summary: FIND AND REPLACE DIALOG: Allow users to see the replace result before moving ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
Keywords: difficultyMedium, easyHack, skillCpp, topicUI
: 146170 (view as bug list)
Depends on:
Blocks: Find&Replace-Dialog
  Show dependency treegraph
Reported: 2020-11-17 13:52 UTC by Daniele
Modified: 2021-12-11 23:02 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:
Regression By:


Note You need to log in before you can comment on or make changes to this bug.
Description Daniele 2020-11-17 13:52:11 UTC
LibO goes to the next item after replacing, which does not allow for checking what the result of the replacement is. 

When doing complex replacements with Regular Expressions, it is very helpful to check the result before moving on (the next search result can be some pages below)

Thus instead of just "replace" two buttons would be helpful. "Replace" and "Replace & Search".

This should work for any search, bot with and without Regular Expressions.

Steps to Reproduce:
1. Open the search window
2. Enter something to be searched which appears several times in document
3. hit search
4. hit replace

Actual Results:
The replacement is made and LibO searches for the next search string.

Expected Results:
instead of just "replace", two buttons would be helpful. "Replace" which shows the results of the replacement and "Replace & Search" which replaces and goes on to the next search.

Reproducible: Always

User Profile Reset: No

Additional Info:
This option is present in other popular wordprocessors.
Comment 1 Dieter 2020-12-07 19:48:12 UTC
Enhancement request is clear to me.

cc: Design-Team for further input and decision
Comment 2 Heiko Tietze 2020-12-08 13:44:57 UTC
I can follow the use case but disagree with the proposed solution. Ideally we get rid of some buttons rather than adding more. Something like Replace acts on all selected to Replace All you have to select all by Find All. Hard to figure out, bad solution.

Regarding the actual use case we could add a checkbox "[x] Find Next on Replace" (on by default) and put it under the options below.
Comment 3 csongor 2020-12-15 15:50:52 UTC
What do you think about an idea when the user needs to click only one button again and again?

There could be a checkbox on the dialog:

[X] Show changed text before progress

If this checkbox is unchecked then it works as usually. Otherwise, clicking the Replace button would work like this:

1. find and highlight the first occurrence
2. replace the selection with the new content and keep it highlighted
3. find and highlight the second occurrence
4. replace the selection with the new content and keep it highlighted
5. find and highlight the third occurrence

It also needs some change on the dialog (a new checkbox instead of the requested new button) but it would be easier to use.
Comment 4 jan d 2020-12-15 20:38:40 UTC
Do we have any prior similar solutions for this? I tried at least with two editors (VSCode and gEdit) and both move on after replacing and have no option to do so otherwise, I also did not see the function on MS Word Screenshots I checked. I understand the problem, but I am not convinced that this is worth adding additional UI elements (or implicit modes).
Comment 5 Heiko Tietze 2020-12-18 14:47:19 UTC
We discussed this topic in the design meeting.

There are concerns that if a feature is needed anyway. But replacement lacks on proper feedback at most applications. And Consgor's idea in comment 3 is tempting. The problem however is how to realize the interaction. Moving the mouse from replace to next and back is annoying. We could change the label/function but it has drawbacks when the search parameters change and exchanging next/replace buttons' position is bad usability and totally confusing. So how to do the Replace->Next->Replace thing?
Comment 6 Heiko Tietze 2021-07-05 11:10:30 UTC
No further input, let's do it.

* Add an option "[ ] Find Next before Replace" with the tooltip "Enable this option to remain at the current position after Replace", disabled by default
* Turn the Replace button into Find Next (and disable the other Find Next button); so we start with [Find Next] [Replace] and get [/Find Next/] [Find Next] after replacement
* check with bug 71676 (and resolve wfm)

Code pointer: 

Comment 7 Michael Warner 2021-12-11 15:38:59 UTC
*** Bug 146170 has been marked as a duplicate of this bug. ***