diff options
Diffstat (limited to 'lua/conform/runner.lua')
-rw-r--r-- | lua/conform/runner.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lua/conform/runner.lua b/lua/conform/runner.lua index 2810948..ff58570 100644 --- a/lua/conform/runner.lua +++ b/lua/conform/runner.lua @@ -442,8 +442,13 @@ M.build_context = function(bufnr, config, range) end if not config.stdin then + local template = config.tmpfile_format + if not template then + template = ".conform.$RANDOM.$FILENAME" + end local basename = vim.fs.basename(filename) - local tmpname = string.format(".conform.%d.%s", math.random(1000000, 9999999), basename) + local tmpname = + template:gsub("$FILENAME", basename):gsub("$RANDOM", tostring(math.random(1000000, 9999999))) local parent = vim.fs.dirname(filename) filename = fs.join(parent, tmpname) end |