From ad347d70e66737a8b9d62c19df1c0e2c5b2cd008 Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Sat, 6 Jan 2024 10:17:38 -0800 Subject: fix: copy input parameters for will_fallback_lsp --- lua/conform/init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lua') diff --git a/lua/conform/init.lua b/lua/conform/init.lua index 289eb3c..f6ffe38 100644 --- a/lua/conform/init.lua +++ b/lua/conform/init.lua @@ -686,8 +686,10 @@ end ---@param options? table Options passed to |vim.lsp.buf.format| ---@return boolean M.will_fallback_lsp = function(options) - options = options or {} - if not options.bufnr or options.bufnr == 0 then + options = vim.tbl_deep_extend("keep", options or {}, { + bufnr = vim.api.nvim_get_current_buf(), + }) + if options.bufnr == 0 then options.bufnr = vim.api.nvim_get_current_buf() end local matching_filetype = get_matching_filetype(options.bufnr) -- cgit v1.2.3-70-g09d2