BUGFIX: Fix Error Notifications
These errors need to be wrapped in a delay call in order to actually work, otherwise we run into this error: https://www.reddit.com/r/neovim/comments/qz4wy6/how_can_i_do_this/
This commit is contained in:
@@ -19,15 +19,20 @@ M.run_job = function(endpoint, method, body, callback)
|
|||||||
if callback ~= nil then
|
if callback ~= nil then
|
||||||
callback(data)
|
callback(data)
|
||||||
else
|
else
|
||||||
vim.notify(data.message, vim.log.levels.DEBUG)
|
vim.defer_fn(function()
|
||||||
|
vim.notify(data.message, vim.log.levels.DEBUG)
|
||||||
|
end, 0)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
vim.notify("Could not parse command output!", vim.log.levels.ERROR)
|
vim.defer_fn(function()
|
||||||
|
vim.notify("Could not parse command output!", vim.log.levels.ERROR)
|
||||||
|
end, 0)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_stderr = function(_, output)
|
on_stderr = function(_, output)
|
||||||
vim.notify("Could not run command!", vim.log.levels.ERROR)
|
vim.defer_fn(function()
|
||||||
error(output)
|
vim.notify("Could not run command!", vim.log.levels.ERROR)
|
||||||
|
end, 0)
|
||||||
end
|
end
|
||||||
}):start()
|
}):start()
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user