From 03ad39320c932a5f75321c36ef4231f608450b51 Mon Sep 17 00:00:00 2001 From: Ivan Isakov <60196280+ivanisakov99@users.noreply.github.com> Date: Tue, 7 Apr 2026 11:40:36 -0400 Subject: [PATCH] fix(nvim-lint): Fix `prepend_args` logic `prepend_args` logic doesn't work as expected, as it appends the extra args rather than prepends them. This works for some linter configurations, but breaks other ones that use `-` as the last argument in the default configuration. --- lua/lazyvim/plugins/linting.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/linting.lua b/lua/lazyvim/plugins/linting.lua index 9b1bed29..aa127346 100644 --- a/lua/lazyvim/plugins/linting.lua +++ b/lua/lazyvim/plugins/linting.lua @@ -32,13 +32,19 @@ return { config = function(_, opts) local M = {} + local function list_prepend(dst, src) + for i = 1, #src do + table.insert(dst, i, src[i]) + end + end + local lint = require("lint") for name, linter in pairs(opts.linters) do if type(linter) == "table" and type(lint.linters[name]) == "table" then lint.linters[name] = vim.tbl_deep_extend("force", lint.linters[name], linter) if type(linter.prepend_args) == "table" then lint.linters[name].args = lint.linters[name].args or {} - vim.list_extend(lint.linters[name].args, linter.prepend_args) + list_prepend(lint.linters[name].args, linter.prepend_args) end else lint.linters[name] = linter