-
-
Notifications
You must be signed in to change notification settings - Fork 425
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
Selection actions list #2555
Selection actions list #2555
Conversation
1c64590
to
8ad1bf7
Compare
I don't see anything outright silly there yet ;) |
You might have misunderstood the point of So you'd need to restore Rest looks good to me, but I haven't tested yet. |
ef7ed5a
to
a829e5f
Compare
For the sake of clarity, I don't follow. Notice that
Which actions are you referring to? We have Can we give an example? |
Also, on master, running |
That's your confusion: Try the |
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 tend to agree with @Ambrevar—we need manual escape hatch in the form of (call|run)-selection-action
.
source/mode/prompt-buffer.lisp
Outdated
"M-return" 'return-selection-over-action | ||
"C-return" 'run-selection-action | ||
"M-return" 'return-marks-action | ||
"C-return" 'set-selection-action |
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.
Maybe use some other binding? C-return
is usually used to mark something like forced send or definitive approval. On GitHub, it's used to send commentaries (because mere return
is used to insert newline), for example.
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.
Seems like a reasonable argument to me.
Any suggestion?
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.
@aartaka please review the keybindings.
You're correct! Sorry. Now let's go back to the main topic that you have raised:
We have the command Does it really make sense to have a command that enables a |
74e002b
to
fc4f9ed
Compare
Correct!
Can you give an example? |
ddfa96c
to
5f23aba
Compare
Ok, let's take this slowly. It seems that both @Ambrevar and @aartaka raised concern about the fact that I've deprecated the command Let's take the command Let me describe the behavior on master. When we issue the command interactively, it's possible to disable With this PR, I add the possibility to define several If you consider that we really need 3 commands for cover all of this, I don't oppose. I just think it may be overkill. Perhaps there are use cases that I'm actually disregarding! |
ee9f1ee
to
2dbbbaf
Compare
OK, makes sense now, thanks for the detailed review. So yes, I believe we need 3 commands, because selection action may need to be only manual, in which case we need a trigger key. EDIT: Clarify |
Yes!
EDIT: it's -> its |
Commit f96d8ba introduced a major bug in the hinting interface. At least the one who did it will clean up the mess! Sorry everyone. |
986d5f1
to
065da5d
Compare
020a8fe
to
6cc7af8
Compare
You have a point, even though it seems to be too much work for little to no benefit. Let's stick to what you suggest :) |
Sorry for being overly picky, but the prompter library is the most sensitive part of Nyxt, so we should try to be as clean as possible. It will help us a lot in the future if things go wrong. |
6cc7af8
to
65fba69
Compare
No need to close this PR, as I've been breaking the former one into smaller ones. About keybindings: We need a new keybinding for |
65fba69
to
4492cf1
Compare
What about |
@@ -330,6 +330,9 @@ call.")) | |||
(alex:when-let ((action (first (marks-actions source)))) | |||
(run-thread "Prompter mark action thread" (funcall action (marks source))))) | |||
|
|||
(defmethod default-selection-action ((source prompter:source)) | |||
(first (slot-value source 'selection-actions))) |
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.
Export?
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 thought the same. The reason why I refrained myself from exporting is due to default-return-action
, which isn't exported. I don't see any reason why these shouldn't be consistent.
Because |
I guess I still prefer |
Seems absolutely sound to me, but let's perhaps leave it out of this PR. We should revise all keybindings before 3.0. |
4492cf1
to
88594d1
Compare
Updated changelog, should be ready to merge. @Ambrevar. |
Looks good to me! |
Logic refactoring, since it handled lists of a single element.
Add set-selection-action. Keybindings review. Rename return-selection-over-action to return-marks-action. According to the terminology of the prompter library, return-actions run over marks, not over the selection. Rename action-source to return-action-source to distinguish it from selection-action-source.
856deea
to
0957dec
Compare
Thanks everyone! |
Description
Add the ability to choose from a list of
selection-actions
.Simplify
return-actions
by ensuring it's a list.Fixes #2198
Discussion
Also, I want to test this API with the hinting system. I can imagine it being very helpful in that context.
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.