diff options
author | Steven Arcangeli <stevearc@stevearc.com> | 2024-01-06 10:17:38 -0800 |
---|---|---|
committer | Steven Arcangeli <stevearc@stevearc.com> | 2024-01-06 10:17:41 -0800 |
commit | ad347d70e66737a8b9d62c19df1c0e2c5b2cd008 (patch) | |
tree | d1de1a6f3113e4dd9ac37bb4dc2e0ccb03427e46 /lua | |
parent | a8e39359814b7b5df5fac7423b4dc93826d64464 (diff) |
fix: copy input parameters for will_fallback_lsp
Diffstat (limited to 'lua')
-rw-r--r-- | lua/conform/init.lua | 6 |
1 files changed, 4 insertions, 2 deletions
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) |