fix: silence doautocmd errors

This produced an error when the ssh adapter terminal was open, and then
a connection error occurred. It would produce a `Can't re-enter normal
mode from terminal mode` error.
This commit is contained in:
Steven Arcangeli 2023-01-04 01:45:28 -08:00
parent 9f7c4d74e1
commit 9dbf18a524

View file

@ -541,9 +541,9 @@ M.setup = function(opts)
if new_url ~= params.file then
util.rename_buffer(bufnr, new_url)
end
vim.cmd.doautocmd({ args = { "BufReadPre", params.file }, mods = { silent = true } })
vim.cmd.doautocmd({ args = { "BufReadPre", params.file }, mods = { emsg_silent = true } })
view.initialize(bufnr)
vim.cmd.doautocmd({ args = { "BufReadPost", params.file }, mods = { silent = true } })
vim.cmd.doautocmd({ args = { "BufReadPost", params.file }, mods = { emsg_silent = true } })
end
if adapter.normalize_url then