From ac641ea8d39ac941da047f749176a691ee12eb1e Mon Sep 17 00:00:00 2001 From: Oscar Wallberg Date: Sat, 12 Apr 2025 17:02:25 +0200 Subject: [PATCH] fix(linter): replace template variables on each invocation --- lua/lsp/linter.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lsp/linter.lua b/lua/lsp/linter.lua index 63b5b20..7c92d0e 100644 --- a/lua/lsp/linter.lua +++ b/lua/lsp/linter.lua @@ -277,8 +277,8 @@ function M:run(bufnr) input = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false) end - local cmd = self.config.cmd - local file = vim.fn.expand("%") + local cmd = vim.fn.copy(self.config.cmd) + local file = vim.fn.expand("%:.") local filename = vim.fn.expand("%:t") for i, arg in ipairs(cmd) do arg = arg:gsub("%%file%%", file)