Closed idmitryd closed 2 years ago
The problem is that vim.ui.input
is not a drop-in replacement for vim.fn.input
. vim.fn.input
is blocking and so your function won't return until you have given it input. vim.ui.input
returns immediately (when your path_to_program
variable is still '???') and calls the callback later. In order for this to work you'll need to either convince the author of nvim-dap to support async functions or callbacks in these config options, or you'll need to use vim.ui.input
to get and set the program name before you activate nvim-dap.
I got it. Thank you for the reply.
Hello, I want to use
vim.ui.input()
to set path to executable fornvim-dap
. I managed to do it with defaultvim.ui.input()
(which simply callsvim.fn.input()
as I understand) as follows:But when I tried to use
dressing.nvim
implementation ofvim.ui.input()
in the same manner I faced two issues:<cmd>lua require'dap'.continue()<cr>
popup window that serves for setting path to executable opens as expected but then it immediately closes so I cannot write anything in there.on_confirm
function changespath_to_program
variable as expected inside its scope but in the end when the variable has to be returned it equals '???' as before the change. So change of the variable insideon_confirm
does not take effect.Could you please help me to figure out how to properly use
vim.ui.input()
in this case?Edit: I use NVIM v0.6.0.