Skip to content

Commit

Permalink
fix: pre-0.9 support for postcmds
Browse files Browse the repository at this point in the history
  • Loading branch information
willothy committed Apr 9, 2023
1 parent ebcdce4 commit 3508bea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/flatten/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3508bea

Please sign in to comment.