From 3508beaa48d316937d8332d17f7ddc1b7d3f9a83 Mon Sep 17 00:00:00 2001 From: Will Hopkins Date: Sat, 8 Apr 2023 17:01:46 -0700 Subject: [PATCH] fix: pre-0.9 support for postcmds --- lua/flatten/core.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)