globally apply fix from #197 (table ref copy overrides globals)

main
bhagwan 3 years ago
parent ac0862cfb1
commit 056ee93169

@ -542,7 +542,11 @@ function M.normalize_opts(opts, defaults)
if not opts then opts = {} end
-- First, merge with provider defaults
opts = vim.tbl_deep_extend("keep", opts, defaults)
-- we must clone the 'defaults' tbl, otherwise 'opts.actions.default'
-- overrides 'config.globals.lsp.actions.default' in neovim 6.0
-- which then prevents the default action of all other LSP providers
-- https://github.com/ibhagwan/fzf-lua/issues/197
opts = vim.tbl_deep_extend("keep", opts, utils.tbl_deep_clone(defaults))
-- Merge required tables from globals
for _, k in ipairs({ 'winopts', 'keymap', 'fzf_opts', 'previewers' }) do

@ -320,13 +320,7 @@ M.workspace_symbols = function(opts)
end
M.code_actions = function(opts)
-- we must clone the 'opts' tbl, otherwise 'opts.actions.default'
-- overrides 'config.globals.lsp.actions.default' in neovim 6.0
-- which then prevents the default action of all other LSP providers
-- https://github.com/ibhagwan/fzf-lua/issues/197
-- not applying this fix yet inside 'config.normalize_opts' as
-- I'm not sure what other butterfly effects this may cause
opts = utils.tbl_deep_clone(normalize_lsp_opts(opts, config.globals.lsp))
opts = normalize_lsp_opts(opts, config.globals.lsp)
if not opts then return end
-- irrelevant for code actions and can cause
-- single results to be skipped with 'async = false'

Loading…
Cancel
Save