! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[PATCH] Find and Replace Search Direction defaults to down
Status:
RESOLVED: MOVED
Product:
Mousepad
Component:
General

Comments

Description flocculant 2014-11-09 17:19:43 CET
In a text file when using search and replace, search direction is set to Down by default.

That assumes that you've started search at file beginning.

Especially in a longer text file you might well start somewhere other than the start.

Changing default search to Both makes more sense when searching somewhere other than the start or end - a more likely scenario.
Comment 1 Andre Miranda editbugs 2014-11-20 00:54:12 CET
IMHO this "Both" option is confusing, a additional option like "Wrap search" or "Wrap around" is much more sane (and is the way pretty much text editors handle this).
Also, when the "Replace all in:" option is active, "Search direction" is 
useless and could deactivated.
Comment 2 Simon Steinbeiss editbugs 2015-01-19 22:29:13 CET
@Andre: From what I've tested "both" just wraps the search after searching "down" is done.
Comment 3 Andre Miranda editbugs 2015-01-20 03:01:16 CET
Yeah, I know, what I mean is that "Both" as a search direction is strange, how can a search be done up and down? Instead it just goes down and then wraps to the beginning.
Comment 4 Simon Steinbeiss editbugs 2015-01-22 18:15:52 CET
So basically you're saying that the string is misleading? I guess we should check how this option is named in other editors.
Comment 5 Andre Miranda editbugs 2015-01-22 19:13:21 CET
Yep, it's confusing.
As I stated in comment #1, this would be a case to create another option(chechbox) for Wrap Search.
Comment 6 Theo Linkspfeifer editbugs 2019-11-12 23:30:47 CET
Created attachment 9218 
0001-Add-Wrap-around-check-box-to-Find-and-Replace-dialog.patch
Comment 7 Theo Linkspfeifer editbugs 2019-11-12 23:31:24 CET
Created attachment 9219 
0002-Update-window-title-of-Find-and-Replace-dialog.patch
Comment 8 Theo Linkspfeifer editbugs 2019-11-12 23:32:00 CET
Created attachment 9220 
0003-Do-not-update-occurrences-counter-when-pressing-Find.patch
Comment 9 Theo Linkspfeifer editbugs 2019-11-12 23:37:10 CET
Created attachment 9221 
0004-Properly-disconnect-signal-handlers.patch

This patch is needed to fix an issue that occurs when closing and opening the Find and Replace dialog.
Comment 10 Andre Miranda editbugs 2019-12-08 21:47:40 CET
Hmmm, I don't know if I'm doing wrong, but it seems Wrap around is not working, once it reaches the end of the document it doesn't start from the beginning (same behavior for Find and Replace).
Also, Search direction only makes sense if Replace all in is not checked
Comment 11 Theo Linkspfeifer editbugs 2019-12-09 14:38:39 CET
I had to install the compiled Mousepad to /usr/local so that the updated gsettings schema file would be used.

You mean the widget sensitivity should be dynamically changed?
Comment 12 Andre Miranda editbugs 2019-12-10 17:32:22 CET
(In reply to Theo Linkspfeifer from comment #11)
> I had to install the compiled Mousepad to /usr/local so that the updated
> gsettings schema file would be used.
Yes confirmed, now it's working almost as expected, only when Search direction is Up and Wrap around is checked, Find won't continue from bottom when the top is reached.

> You mean the widget sensitivity should be dynamically changed?
Maybe not, Find doesn't work only if Replace all in: Selection is selected, for the other options Wrap around works, only the direction is always Down. (This dialog is somewhat buggy already, feel free to handle those problems later).
Comment 13 Theo Linkspfeifer editbugs 2019-12-11 23:50:53 CET
The search direction is ignored in that case due to the "! replace_all" check here:
https://git.xfce.org/apps/mousepad/tree/mousepad/mousepad-replace-dialog.c#n321
Comment 14 Git Bot editbugs 2020-05-24 01:29:25 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/apps/mousepad/-/issues/15.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #11290

Reported by:
flocculant
Reported on: 2014-11-09
Last modified on: 2020-05-24

People

Assignee:
Matthew Brush
CC List:
4 users

Version

Version:
Unspecified
Target Milestone:
Mousepad 0.2.x

Attachments

Additional information