-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add support for history #4
Comments
An idea: A nice feature would be to show the last 1-3 history items (configurable) above the selected candidate. I imagine this feature similar to ivys One downside of this approach would be the increased distance from a possibly selectable prompt. But one could jump to it with |
Oh I just realized that by default, minibuffer history stores your actual inputs and not the submitted candidate. Independently of my previous idea above I think for selectrums model it would be better to store the complete candidate. I understand you don't want to divert to much from the default API, though in this case it might make sense to change the history handling as long as the user uses selectrum. |
If you want previously selected candidates to be sorted at the top of the list, you should be using |
Thanks, I know and I have done that before but I like the more snappy behavior I get without prescient sorting and I like to have command based history storage which prescient doesn't do. With command based history I can invoke a command that I haven't invoked for a long time and still have the last used items at the top. Maybe when minibuffer history for selectrum gets implemented it could be done in a way that so that one has access to the current minibuffer history variable inside |
To be clear: all of the following is just an opinion, and if you think I've missed something, feel free to point it out. I've been wrong about design many times before.
This is desired, and I don't want to change the default behavior. Typing
I don't think this is a good road to go down. It complicates the abstraction considerably, and I am not convinced that the relevant use cases cannot be addressed using the existing system. Selectrum should not maintain any candidate history. This is out of scope for the project, and should be handled by an external package which adjusts the preprocessing and refinement functions, such as
Is there any reason why you can't implement your desired functionality using the same hooks that Also, if you can think of a way to implement your own logic that is sufficiently performant for your needs, it's possible that we could simply fix |
The same goes for my suggestions/ideas which might sometimes be out of selectrums design philosophy ;)
I agree that selectrum should probably behave like the default minibuffer. But I still think that the default history feature is sub optimal with completion frameworks like selectrum. Usually I'm interested about candidates I have chosen lately not how I searched for them and what the exact results of the search where. But it's not possible to fix that while staying compatible to stock minibuffer behavior. Maybe selectrum could offer a way to configure how history is stored by a simple
It's certainly possible to implement this using hooks and a custom sort function but because I'm not interested to use the default history input feature (because of the reasons mentioned earlier) I'm looking for way to make use of the existing history mechanism. Things like
Making prescient faster would certainly help but having per command history would be more important to me and using a simple sorting mechanism like pushing the last items to the front would be enough for my purposes. I think implementing the default behavior with an easy way to adjust it would be optimal, at least from my point of view ;) |
After experimenting a bit it seems all that is necessary is to pass the history variable to |
Actually my claim was wrong: Ivy does save the actual input but with the default interface your input is the actual chosen candidate anyway. |
Is it too late to request support for history search? I really like how the default |
@gcv That is a good idea. It is possible to swap the current candidate set by overwriting |
551b119 should make the |
No on all counts. 🙃
Looking at the code, PS: In any case, |
History is now implemented. @gcv Would you mind opening new issue(s) for the problems that still exist with |
Done, thanks! |
By default, it should be possible to use
M-p
andM-n
to navigate the history of previous user inputs to Selectrum.The text was updated successfully, but these errors were encountered: