-
-
Notifications
You must be signed in to change notification settings - Fork 831
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
Cycle prompt history #521
Cycle prompt history #521
Conversation
d60ec2b
to
31a467e
Compare
Maybe I'm doing something wrong or it's related with the PR pointed out on the description. Anyway, after the installation and configs setup, I'm facing the above error when trying to open files:
@Conni2461 did you've any clue on that? |
Oh yeah i have an update for that that i didn't push because i wasn't done yet 😆 I will just push the fix for that now :) Edit: I have some issues with not correctly resetting the index on exit and more stuff. I try to work some more on it later :) |
31a467e
to
82c86d4
Compare
Another new version that should work better now. History gets loaded only once on first time. I still need to clean that up in a separate module and add a |
@Conni2461, what is the status of it? |
I was super busy for the past few weeks but this will change next Wednesday. Then i will finish it. Shouldn't take that long :) |
060b70e
to
03ad182
Compare
Okay this is now somewhat done. I changed the name of the config var to Short: history_location = '~/.local/share/nvim/telescope_history', -- default nil, history disabled
history_limit = 1000, -- default nil (limiter disabled), |
61e8047
to
b8822c0
Compare
@Conni2461 awesome pr, it's really an important missing feature, @saragiotto great suggestion
I kinda disagree, I mean I can understand why it shouldn't be unique or should be unified for your use-case as I presume that you intend to use it only for the very last input in case you accidentally closed the picker, or when you open several files in order and want to easily switch between them. But what about other use-cases? for example
Thus, I strongly dismiss the idea of a unified history for ALL pickers, One of the core features of telescope is that every Picker has it's own world (preview, theme, layout, mappings .. etc) and history shouldn't be treated differently. History, I believe, should be unique PER |
07f92f1
to
cff5a2f
Compare
Idea:
Thoughts @Shatur95 @saragiotto @elianiva @tami5 I would start working on this Saturday. I wanna get this done as soon as possible. :) |
Seems like a good idea to me, though I'm not sure what "context sensitive" history is 😆 |
Basically what tami said. A history for each picker (i just thought context sensitive made sense, maybe not). |
Right, that would be nice. |
6c78b3e
to
b46c9e7
Compare
hi, may I ask for an update on this PR? |
985a5c0
to
727dd77
Compare
I just rebased it. Sadly the action api is lacking, so history will not be saved in all pickers. Missing are the once that do I could implement a workaround for that but i haven't asked tj if that is the best idea. I will do that when he comes back from his vacation. But there is no reason why you couldn't check out the branch and run it. :) I would appreciate some feedback ;) |
I feel as if actions.cycle_history_prev/next should throw an error to :messages if the user hasn't set history_location. If you bind the actions (C-p, C-n) but forget to set history_location, pressing the bound keys does nothing (which is obviously expected behavior) |
Why not default to somewhere in |
There is |
AFAIK its not enabled on default for fzf. Enabling it on default also requires mapping I checked and it seems that i am currently suggesting But i don't see a reason to print a error message if history isn't enabled and the actions are mapped and/or used |
ad3befa
to
cf9d15f
Compare
To enable add this to your config: history_location = '~/.local/share/nvim/telescope_history', Currently not mapped by default, add mappings like this to your config: mappings = { i = { ["<C-n>"] = actions.cycle_history_next, ["<C-p>"] = actions.cycle_history_prev, }, }, To set a history_limit add this to your config: history_limit = 1000,
cdb59d3
to
afb7468
Compare
5bec787
to
affe310
Compare
skip-checks: true
ff654ea
to
7d15d0f
Compare
Close #520
Showcase: https://streamable.com/w3wpri
Enabled on default you only need to add mappings
For more information
:help telescope.defaults.history
CC @saragiotto