Order longest match first in global search results
This is probably best illustrated with an example. If I press Ctrl+.
when editing gnome-software in Builder, and type plugin-flatpak
, I get the following list of results:
plugins/flatpak/gs-flatpak.c
plugins/flatpak/gs-flatpak.h
plugins/flatpak/gs-flatpak-app.c
plugins/flatpak/gs-flatpak-app.h
plugins/flatpak/gs-flatpak-utils.c
plugins/flatpak/gs-flatpak-utils.h
plugins/flatpak/gs-plugin-flatpak.c
plugins/flatpak/gs-flatpak-transaction.c
plugins/flatpak/gs-flatpak-transaction.h
The file I want is gs-plugin-flatpak.c
, which is the 7th result. All the results have matched on plugin
from the plugins/
directory, and flatpak
from the gs-flatpak-
prefix. gs-plugin-flatpak.c
matches like that too. But it has a longer substring match of plugin-flatpak
which isn’t highlighted. I think that longer substring match should cause gs-plugin-flatpak.c
to be the first search result.
This is with Builder 3.32.3.