mirror of
https://github.com/neovim/neovim.git
synced 2026-04-21 23:05:41 +00:00
fix(lsp): call on_list before reading loclist #37645
Problem: `on_list` is supposed to replace the default list-handler. With the current order of these `if` statements `on_list` won't be called if `loclist` is true. Solution: Change the order of the relevant blocks.
This commit is contained in:
@@ -870,12 +870,12 @@ function M.references(context, opts)
|
|||||||
bufnr = bufnr,
|
bufnr = bufnr,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
if opts.loclist then
|
if opts.on_list then
|
||||||
vim.fn.setloclist(0, {}, ' ', list)
|
|
||||||
vim.cmd.lopen()
|
|
||||||
elseif opts.on_list then
|
|
||||||
assert(vim.is_callable(opts.on_list), 'on_list is not a function')
|
assert(vim.is_callable(opts.on_list), 'on_list is not a function')
|
||||||
opts.on_list(list)
|
opts.on_list(list)
|
||||||
|
elseif opts.loclist then
|
||||||
|
vim.fn.setloclist(0, {}, ' ', list)
|
||||||
|
vim.cmd.lopen()
|
||||||
else
|
else
|
||||||
vim.fn.setqflist({}, ' ', list)
|
vim.fn.setqflist({}, ' ', list)
|
||||||
vim.cmd('botright copen')
|
vim.cmd('botright copen')
|
||||||
|
|||||||
Reference in New Issue
Block a user