From b35e22c560088f7000eb2c7270cb4a88b66d4139 Mon Sep 17 00:00:00 2001 From: Oscar Wallberg Date: Wed, 21 May 2025 00:16:19 +0200 Subject: [PATCH] feat(format): add env option --- lua/ow/utils.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/ow/utils.lua b/lua/ow/utils.lua index e51b86e..efbcb22 100644 --- a/lua/ow/utils.lua +++ b/lua/ow/utils.lua @@ -165,6 +165,7 @@ end ---@field auto_indent? boolean Perform auto indent on formatted range. False by default. ---@field only_selection? boolean Only send the selected lines to `stdin`. False by default. ---@field ignore_ret? boolean Ignore non-zero return codes +---@field env? table Map of environment variables --- Format buffer ---@param opts FormatOptions @@ -174,6 +175,7 @@ function M.format(opts) output = opts.output, auto_indent = opts.auto_indent or false, only_selection = opts.only_selection or false, + env = opts.env, } if @@ -260,6 +262,7 @@ function M.format(opts) err = err and err .. e or e end end, + env = opts.env, }):wait() local tmp_out