fix(terminal): ensure mappings and autocommands set

for custom terminals
fixes #459
This commit is contained in:
Akin Sowemimo 2023-07-10 08:21:37 +01:00
parent 2249e974fa
commit 0144aaaaf0

View file

@ -394,6 +394,8 @@ function Terminal:__spawn()
})
self.name = cmd
self.dir = dir
setup_buffer_autocommands(self)
setup_buffer_mappings(self.bufnr)
end
---@package
@ -455,8 +457,6 @@ function Terminal:spawn()
self.bufnr = ui.create_buf()
self:__add()
api.nvim_buf_call(self.bufnr, function() self:__spawn() end)
setup_buffer_autocommands(self)
setup_buffer_mappings(self.bufnr)
if self.on_create then self:on_create() end
end
end