Skip to content
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

FR: history of vim.ui.input when aborting & across sessions #118

Open
chrisgrieser opened this issue Sep 22, 2023 · 2 comments
Open

FR: history of vim.ui.input when aborting & across sessions #118

chrisgrieser opened this issue Sep 22, 2023 · 2 comments
Labels
enhancement New feature or request P2 Not a priority. PRs welcome

Comments

@chrisgrieser
Copy link
Contributor

A minor QoL thing, but I noticed that when I abort an input, and then call the same command again, the text I previously typed is gone and also not available in the history.

So when I want to do sth, remember that I have to do something beforehand, I have to <Esc>yy<Esc>, do the thing I forgot, call the input field again, and then <Esc>pA. All that hassle could be avoided by saving the text of an aborted input in the history. Maybe as an opt-in, if it is not desirable for all users?

Somewhat related, it seems the history only persists during a session, after restarting nvim, I cannot find previous entries anymore with <Up>. I'd definitely find a persistent history useful. (Maybe with a max-history size or something?)

@stevearc
Copy link
Owner

I think it would be reasonable to save and restore the last value if the user cancels out of an input window, provided that the default value is empty. Does that match your use case?

@chrisgrieser
Copy link
Contributor Author

Kind of. But restoring the last value of a cancelled input in general could also be annoying, because you do not always want to re-use that text. Thus, the idea of prepending the item to the history.

Alternatively, there could also be some sort of timeout maybe? For example, "if an input is re-opened within 5 minutes, restore the value, otherwise, start empty"

@stevearc stevearc added the enhancement New feature or request label Oct 11, 2023
@stevearc stevearc added the P2 Not a priority. PRs welcome label Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P2 Not a priority. PRs welcome
Projects
None yet
Development

No branches or pull requests

2 participants