! 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] Useless and annoying search when invoking "find"
Status:
RESOLVED: MOVED
Product:
Mousepad
Component:
General

Comments

Description Tamaranch 2020-05-20 11:34:30 CEST
Created attachment 9878 
0001-Don-t-search-for-previously-selected-text.patch

If a search has already taken place, and the "find" feature is invoked again, a search is automatically launched for the previously selected text, which is not what we generally want.

It moves us from where we are to find something that is out of date, which is quite confusing and annoying.

If we actually want to search for this text again, we just have to press enter, but this search should not be automatic.

The patch for that is straightforward.

NB: Note also that the function whose call is eliminated in the patch: mousepad_search_bar_entry_changed(), is partly redundant with the function which calls it: mousepad_search_bar_focus().
Comment 1 MDC 2020-05-20 16:44:48 CEST
A gentle objection to this change.  This behavior in Mousepad mimics every GUI text editor I've used, and the behavior has been around in all those applications, including Mousepad, for years.  Changing it would give Mousepad an inconsistent behavior compared to other applications and would surely break someone's workflow.
Comment 2 Tamaranch 2020-05-20 17:13:53 CEST
I don't have this behavior in Atom for instance.

Are we talking about the exact same thing?
I don't mean that the search field is filled with the previous search (classic behavior), I mean that this search is restarted when you type ^F.
Comment 3 Tamaranch 2020-05-20 17:21:07 CEST
I don't have this behavior in Gedit either.
Comment 4 MDC 2020-05-20 17:43:07 CEST
I suspected I might have misunderstood you at a first pass.  Apologies, and thanks for clarifying.

When you say 'restarted', do you mean that the search results will start from the top of the file again?  I'm trying to see if I can reproduce the behavior in my version.
Comment 5 Tamaranch 2020-05-20 18:09:40 CEST
No problem :)

I mean that the search is launched again (technically the function mousepad_search_bar_entry_changed() is called), exactly as if you had done a new selection and search.
Hence the cursor is moved from where we are to the first match, for a search that we generally don't care anymore.

Generally, if one types ^F without selecting any text, it is only to have access to the search field to type something new, not to relaunch the previous search (that's why in this case, the previously searched text is entirely selected in the search field, so that typing any letter erases it).
And the cursor should stay where it was before typing ^F, just like in Atom, Gedit or any other editor I think.
Comment 6 Git Bot editbugs 2020-05-24 01:34:43 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/51.

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 #16872

Reported by:
Tamaranch
Reported on: 2020-05-20
Last modified on: 2020-05-24

People

Assignee:
Matthew Brush
CC List:
2 users

Version

Target Milestone:
Mousepad 0.4.x

Attachments

Additional information