From 5f44892fdaebf3fc617f17caa6d32cd926149983 Mon Sep 17 00:00:00 2001 From: timteee_ <102175985+timTonelli@users.noreply.github.com> Date: Wed, 13 Nov 2024 18:37:59 -0500 Subject: [PATCH] fix: allow functions that return strings for output --- lua/freeze/init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/freeze/init.lua b/lua/freeze/init.lua index c33d192..d20a33a 100644 --- a/lua/freeze/init.lua +++ b/lua/freeze/init.lua @@ -89,7 +89,12 @@ end local function open_by_os(args) local is_win = vim.loop.os_uname().sysname:match("Windows") local is_linux = vim.loop.os_uname().sysname:match("Linux") - local output = vim.fn.expand(args.output) + local output + if type(args.output) == "function" then + output = vim.fn.expand(args.output()) + else + output = vim.fn.expand(args.output) + end local cmd = {} if is_win then table.insert(cmd, "explorer")