Skip to content

Conversation

@ldelossa
Copy link

Prior to this commit there was no graceful way to cancel the pattern
input of the grep picker.

Hitting ctrl-c created an error.
Any other natural form of cancellation returned an empty string, which
blocked the picker in large repos for quite some time.

Replace vim.fn.input with vim.ui.input which properly distinguishes
a cancellation of the prompt from an empty input string.

Prior to this commit there was no graceful way to cancel the pattern
input of the grep picker.

Hitting `ctrl-c` created an error.
Any other natural form of cancellation returned an empty string, which
blocked the picker in large repos for quite some time.

Replace `vim.fn.input` with `vim.ui.input` which properly distinguishes
a cancellation of the prompt from an empty input string.

Signed-off-by: ldelossa <louis.delos@gmail.com>
@echasnovski
Copy link
Member

Thanks for the PR!

All 'mini.nvim' modules (well, except a single occasion) intentionally use vim.fn.input for consistent experience. Replacing it with vim.ui.input (or a more narrow alternative) is planned, but only if there is a way to force its execution to be synchronous. This is important in modules like 'mini.ai' and 'mini.surround'.

Until then, replacing with vim.ui.input is not planned.


As per respecting cancel in MiniPick.builtin.grep (which I'd appreciate if it first would have been an issue), this should now be resolved on latest main. Thanks for reporting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants