After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 785942 - Doesn't prefer start matches, makes typeahead impossible
Doesn't prefer start matches, makes typeahead impossible
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: File and Folder Operations
3.24.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-08-07 11:42 UTC by Sebastien Bacher
Modified: 2017-08-17 13:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
example from fedora26 showing the issue (22.75 KB, image/png)
2017-08-07 11:42 UTC, Sebastien Bacher
  Details
query: prefer prefix matches over sufix matches (1.15 KB, patch)
2017-08-10 13:58 UTC, Alexandru Pandelea
none Details | Review
query: prefer prefix matches over sufix matches (1.67 KB, patch)
2017-08-15 16:44 UTC, Alexandru Pandelea
committed Details | Review

Description Sebastien Bacher 2017-08-07 11:42:55 UTC
Created attachment 357107 [details]
example from fedora26 showing the issue

Using nautilus 3.24, when typing on the keyboard some text nautilus filters the matching folders but it doesn't rank start-matches higher which means you can't use a type-some-letter -> enter workflow (aka typeahead) to browse your subfolders as it used to be possible in nautilus
Comment 1 Sebastien Bacher 2017-08-07 11:43:46 UTC
in the example the user wants to go to "aclocal" and type "ac + <enter>" and ends up in the emacs directory...
Comment 2 Alexandru Pandelea 2017-08-10 13:58:26 UTC
Created attachment 357341 [details] [review]
query: prefer prefix matches over sufix matches

Currently, the number of letters before and after the match decrease
the rank of the search hit by the same amount.

Though, the prefix matches should be prefered over the sufix ones,
so make the number of letters after the match decrease the rank
by a much smaller factor than the number of letters before the match.
Comment 3 Carlos Soriano 2017-08-15 16:21:12 UTC
Review of attachment 357341 [details] [review]:

Cool! Just a nitpick:

::: src/nautilus-query.c
@@ +400,3 @@
     }
 
+    retval = MAX (10.0, 50.0 - (gdouble) (ptr - prepared_string) - (gdouble) nonexact_malus / 100);

can we you put a comment and also names to the constants? It's becoming a little hard to understand at first glance.
Comment 4 Alexandru Pandelea 2017-08-15 16:44:40 UTC
Created attachment 357648 [details] [review]
query: prefer prefix matches over sufix matches

Currently, the number of letters before and after the match decrease
the rank of the search hit by the same amount.

Though, the prefix matches should be prefered over the sufix ones,
so make the number of letters after the match decrease the rank
by a much smaller factor than the number of letters before the match.
Comment 5 Carlos Soriano 2017-08-15 19:03:40 UTC
Review of attachment 357648 [details] [review]:

Excellent, thanks!
Comment 6 Carlos Soriano 2017-08-17 13:57:19 UTC
Attachment 357648 [details] pushed as a6d616e - query: prefer prefix matches over sufix matches