-
-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use filter-exact-matches in much more places. #2868
Conversation
@@ -28,7 +28,8 @@ | |||
(mapc #'reopen-dead-buffer buffer-list) | |||
(set-current-buffer (or (first (prompter:marks (current-source))) | |||
(current-suggestion-value (current-prompt-buffer))))) | |||
(lambda-mapped-command reopen-dead-buffer))))) | |||
(lambda-mapped-command reopen-dead-buffer))) | |||
(prompter:filter-preprocessor #'prompter:filter-exact-matches))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why for buffers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because buffers have URLs in them, and because buffer-source
is used in set-url
to match against buffers. In the latter case, it's extremely important to filter aggressively, so that the source disappears the very moment it becomes irrelevant.
@@ -279,6 +284,7 @@ Otherwise go forward to the only child." | |||
(define-class history-all-source (prompter:source) | |||
((prompter:name "All history URLs") | |||
(buffer :initarg :buffer :accessor buffer :initform nil) | |||
(prompter:filter-preprocessor #'prompter:filter-exact-matches) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it's not just URLs, it's also titles, so this may be too restrictive.
Same for all history sources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then wait, filter-exact-matches
matches against every word separately, so titles are fine too: if there's a word from a title and a word from a URL, the suggestion is still matched, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, but fuzzy-matching on titles is desirable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd still say that most of people search things by space-separated chunks of text, so fuzzy matching that works backwards or matches every single letter is not as useful as matching clearly delineated word-like sequences.
a9d6cb1
to
78bd832
Compare
I'm taking a look at this later today or tomorrow. Thanks! |
Yes, I just was unable to find the issue xD
I lean to that too, because |
This way, sources disappear when having no matches, or narrow down to the useful suggestions really fast. This is particularly important when dealing with lots of noisy data, like URLs, colors, lots of text entries. The default preprocessor, delete-inexact-matches, is insufficient, as it matches all the suggestion against any substring of input, which almost always passes most elements through.
78bd832
to
b1c946e
Compare
This makes most of our sources more exact in matching the input. This is important for sources with URLs, medium-to-huge quantities of text, or many-attributes sources.
Please, someone, just look at this change and accept that our sources are more exact and useful now :)
Closes #2792.
Discussion
nyxt/gi-gtk
tests fail even on master :PChecklist:
Everything in this checklist is required for each PR. Please do not approve a PR that does not have all of these items.
cd /path/to/nyxt/checkout git submodule add https://gitlab.common-lisp.net/nyxt/py-configparser _build/py-configparser
:documentation
s written in the aforementioned style. (It's OK to skip the docstring for really trivial parts.)changelog.lisp
with my changes if it's anything user-facing (new features, important bug fix, compatibility breakage).migration.lisp
entry for all compatibility-breaking changes.(asdf:test-system :nyxt)
and(asdf:test-system :nyxt/gi-gtk)
) and they pass.