Skip to content

Commit

Permalink
fix: silence doautocmd errors
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stevearc committed Jan 4, 2023
1 parent 9f7c4d7 commit 9dbf18a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/oil/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9dbf18a

Please sign in to comment.