Open smartinellimarco opened 5 months ago
Any ideas on how to solve this? 😢
See #93 for context on why this option and prompt exist in the first place.
The command line prompt is because the place where I needed to inject this confirmation really was not a great location to add another callback, it would have made the code a bit too gnarly. So I used vim.fn.confirm
instead because it will block execution waiting for user input. If someone wants to try to make that call async in a way that isn't horrible, be my guest. Ideally I'd like to rewrite all of oil's async logic using an async/await style library instead of using callbacks, but I've been waiting for an official Neovim implementation or at least endorsement.
This prompt is shown even with 'prompt_save_on_select_new_entry' set to false.
I could not get this to repro, the option works as expected for me. Confirm that you have everything spelled correctly and that you're setting the option in the right place.
@stevearc Just to add to this issue, were you able to reproduce the double confirmation for this sequence? One from vim.fn.confirm and the other from Oil itself.
Did you check the docs and existing issues?
Neovim version (nvim -v)
9.5.0
Operating system/version
MacOS 14.3
Describe the bug
When creating and selecting a new file, oil will prompt you to save it (as the option says), but using the commandline instead of the floating pop up.
This prompt is shown even with 'prompt_save_on_select_new_entry' set to false.
Furthermore, pressing 'Esc' or cancelling the prompt, will open the new buffer anyways. This leads to strange behaviors, i.e, if you save the buffer before saving in oil, oil ask you to create the file afterwards anyways. I would expect oil not creating the buffer at all.
Thanks in advance!
What is the severity of this bug?
minor (annoyance)
Steps To Reproduce
Expected Behavior
Oil prompt asking for confirmation to CREATE the file before editing it.
Directory structure
foo.txt bar.txt new_file.txt
Repro
Did you check the bug with a clean config?
nvim -u repro.lua
using the repro.lua file above.