diff --git a/lua/flatten/core.lua b/lua/flatten/core.lua index fbe17ae..4e8d3be 100644 --- a/lua/flatten/core.lua +++ b/lua/flatten/core.lua @@ -191,7 +191,11 @@ M.edit_files = function(opts) local block = config.block_for[ft] or force_block for _, cmd in ipairs(postcmds) do - vim.api.nvim_exec2(cmd, {}) + if vim.api.nvim_exec2 then + vim.api.nvim_exec2(cmd, {}) + else + vim.api.nvim_exec(cmd, false) + end end callbacks.post_open(bufnr, winnr, ft, block)