fix: use coroutine to get URL
This commit is contained in:
@@ -29,7 +29,6 @@
|
||||
"nvim-cmp": { "branch": "main", "commit": "12509903a5723a876abd65953109f926f4634c30" },
|
||||
"nvim-dap": { "branch": "master", "commit": "1fdfe74661170ce58d37dc46259448987ffe706c" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "bc81f8d3440aede116f821114547a476b082b319" },
|
||||
"nvim-dap-vscode-js": { "branch": "main", "commit": "03bd29672d7fab5e515fc8469b7d07cc5994bbf6" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "637293ce23c6a965d2f11dfbf92f604bb1978052" },
|
||||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "2206739829518c9ea59dbdb9003e0147fdaf2d1c" },
|
||||
|
||||
@@ -124,9 +124,16 @@ return {
|
||||
end
|
||||
|
||||
local enter_launch_url = function()
|
||||
local url = vim.fn.input("URL to launch: ", "http://localhost:")
|
||||
vim.cmd('echo ""')
|
||||
return url
|
||||
local co = coroutine.running()
|
||||
return coroutine.create(function()
|
||||
vim.ui.input({ prompt = "Enter URL: ", default = "http://localhost:" }, function(url)
|
||||
if url == nil or url == "" then
|
||||
return
|
||||
else
|
||||
coroutine.resume(co, url)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
for _, language in ipairs({ "typescript", "javascript", "typescriptreact", "javascriptreact", "vue" }) do
|
||||
|
||||
Reference in New Issue
Block a user