-
-
Notifications
You must be signed in to change notification settings - Fork 404
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 Lparallel-powered prompter library #2998
Conversation
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.
Will have to review prompter refactor, but this one looks OK to me.
Attribute value API prevents dynamic attribute width computation with (define-configuration :prompt-buffer
((dynamic-attribute-width-p t))) Something with futures as values of attributes being passed to the function implying that values are strings. |
And I've allowed myself a liberty of fixing a destructor of |
Oh right, this part of the API has changed. We need to call |
Yes, as you rightly mention
I'll get to it as soon as atlas-engineer/prompter#16 is merged. It's not very smart to start testing until that moment :) Thanks for working on this. It's really important, and I think it will have a great impact on Nyxt! |
@@ -342,7 +342,7 @@ current unmarked suggestion." | |||
(prompter:actions-on-return first-prompt-buffer)) | |||
(progn | |||
(echo-warning "No actions to choose from.") | |||
(error 'prompt-buffer-canceled)))) | |||
(error 'prompt-buffer-canceled)))) ; TODO: Obsolete, switch to `promter:canceled' with 4.0.0. |
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.
We should probably create an issue saying "grep for 4.0.0 to ensure we act prior to its release", otherwise we'll forget it :p
791b730
to
ae47194
Compare
ae47194
to
d80b046
Compare
@aartaka I can't reproduce. Can you give an exact recipe? |
While I still need an example to test the attribute problem, I think I know what's going on.
(if (functionp (second attribute))
(list (attribute-key attribute)
(lpara:future
(handler-case (funcall (second attribute) (value suggestion))
(error (c)
(format nil "keyword error: ~a" c)))))
attribute) Oops! Generally, speaking, this list-based attribute-API is poorly designed and is in great need to be overhauled. But this belong to another Actionable changes for now:
|
a16536e
to
32f3a3f
Compare
Something's off again:
Test it with a (define-configuration :prompt-buffer
((dynamic-attribute-width-p t))) |
Fixed. |
@aartaka This introduces a new bug: Try pressing escape in |
Waaaaait, it was me getting some error in the destructor, checking the
And deciding that |
Feel free to revert it! |
Something was off indeed, the
|
Please reopen when ready. |
Description
This uses the updated
prompter
library from the atlas-engineer/prompter#16 patch set.Fixes #2134 (at least the hang).
Discussion
Shall we merge this on
3-series
? I've tried to retain as much back-compatibility as possible, butprompter
itself is not fully backward compatible. That said, it's concerns only very "under the hood" elements (likeprompter:result-channel
which is now an Lparallel promise).Answer: Yes, let's merge it,
prompter:result
is only used as a lower-level implementation detail.Nyxt freezes when typing very fast in prompt buffer #2134 hang is fixed indeed, however keeping a key pressed is very CPU intensive and pretty slow in the UI. Not sure why, as if the UI was waiting the prompt-buffer. Issue on the Nyxt side? @aartaka @aadcg any idea?
There are still dangling threads.
For the last 2 issues, I think I know what's going on:
update-prompt
is run on each key press, and evidently does not terminate properly.Proposed solution: Use a strategy of "buffering" like the new
prompter
does, so we only update the buffer after some time delay.Also while we are at it, switch from Calispel to Lparallel to avoid the accidental dangling threads.
Better idea? Listening to
prompter
supdate-notifier
would save us having to reimplement this logic.To do:
DO NOT MERGE LAST COMMIT: Instead, wait for
prompter
master to be updated, then update the Git submodule.Checklist:
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.