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

fix(prompt): confirm cwd changing using vim.fn.comfirm #1328

Merged
merged 2 commits into from Jan 30, 2024

Conversation

konosubakonoakua
Copy link
Contributor

It is kind of cumbersome to input "y or n", and press enter for the confirm process, why not just press y or n instead.

new prompt

@cseickel
Copy link
Contributor

I didn't even know that existed, do you know what version of nvim it was added in?

@konosubakonoakua
Copy link
Contributor Author

I didn't even know that existed, do you know what version of nvim it was added in?

I found some thing here: https://github.com/neovim/neovim/blame/5e5b004da44c7075ed1e20ae9d05ab09c6f2ac58/runtime/doc/usr_41.txt#L974

Looks like it is a vim feature, introduced at least 10 years ago. 😄

BTW, I'm using noice.nvim which takes over the confirm ui.
The prompt will show up just below the status bar without the plugin.
You can use nvim -u NONE -c ':lua vim.fn.confirm("Ok or Not?", "&y\n&n")' for a test.

@konosubakonoakua
Copy link
Contributor Author

BTW, shall we replace all the confirm prompt with vim.fn.confirm?

It does need the `==` to handle for different inputs, as selecting no returns `2`, and returns `0`.

Co-authored-by: cseickel <cseickel@gmail.com>
@cseickel cseickel merged commit df4cb47 into nvim-neo-tree:main Jan 30, 2024
2 checks passed
@konosubakonoakua konosubakonoakua deleted the fix/prompt branch March 14, 2024 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants