Find and Replace Search Direction defaults to down

Bug #1390933 reported by Elfy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mousepad
Confirmed
Medium
xubuntu-default-settings (Ubuntu)
Fix Released
Undecided
Sean Davis

Bug Description

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.

Revision history for this message
In , Elfy (elfy) wrote :

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.

Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu Package testing tracker.

A list of all reports related to this bug can be found here:
http://packages.qa.ubuntu.com/qatracker/reports/bugs/1390933

tags: added: package-qa-testing
Changed in mousepad:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , André Miranda (andreldm) wrote :

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.

Revision history for this message
In , Simon Steinbeiß (ochosi) wrote :

@Andre: From what I've tested "both" just wraps the search after searching "down" is done.

Revision history for this message
In , André Miranda (andreldm) wrote :

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.

Revision history for this message
In , Simon Steinbeiß (ochosi) wrote :

So basically you're saying that the string is misleading? I guess we should check how this option is named in other editors.

Revision history for this message
In , André Miranda (andreldm) wrote :

Yep, it's confusing.
As I stated in comment #1, this would be a case to create another option(chechbox) for Wrap Search.

Revision history for this message
Pasi Lallinaho (knome) wrote :
Changed in mousepad (Ubuntu):
status: New → Fix Released
assignee: nobody → Sean Davis (bluesabre)
affects: mousepad (Ubuntu) → xubuntu-default-settings (Ubuntu)
Revision history for this message
In , Theo Linkspfeifer (lastonestanding) wrote :

Created attachment 9218
0001-Add-Wrap-around-check-box-to-Find-and-Replace-dialog.patch

Revision history for this message
In , Theo Linkspfeifer (lastonestanding) wrote :

Created attachment 9219
0002-Update-window-title-of-Find-and-Replace-dialog.patch

Revision history for this message
In , Theo Linkspfeifer (lastonestanding) wrote :

Created attachment 9220
0003-Do-not-update-occurrences-counter-when-pressing-Find.patch

Revision history for this message
In , Theo Linkspfeifer (lastonestanding) wrote :

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.

Revision history for this message
In , Andreldm-2 (andreldm-2) wrote :

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

Revision history for this message
In , Theo Linkspfeifer (lastonestanding) wrote :

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?

Revision history for this message
In , Andreldm-2 (andreldm-2) wrote :

(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).

Revision history for this message
In , Theo Linkspfeifer (lastonestanding) wrote :

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

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.