diff options
author | kylo252 <[email protected]> | 2022-01-03 15:49:07 +0100 |
---|---|---|
committer | kylo252 <[email protected]> | 2022-01-03 15:49:07 +0100 |
commit | e5aa8be8ce54097e4a34220cb2aad114e70f209b (patch) | |
tree | 15e0a3017358b15a0656b6d1f98d2638ae572095 /lua/lvim/lsp/peek.lua | |
parent | 427ad868d404a254dcbc7d3950946dae0cf205de (diff) | |
parent | 21b41688ee8c5056ffbb2b07df141ce1ccb4b213 (diff) |
Merge branch 'rolling'
Diffstat (limited to 'lua/lvim/lsp/peek.lua')
-rw-r--r-- | lua/lvim/lsp/peek.lua | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lua/lvim/lsp/peek.lua b/lua/lvim/lsp/peek.lua index 08345aff..f006f934 100644 --- a/lua/lvim/lsp/peek.lua +++ b/lua/lvim/lsp/peek.lua @@ -47,9 +47,8 @@ local function create_floating_file(location, opts) -- Set some autocmds to close the window vim.api.nvim_command( - "autocmd QuitPre <buffer> ++nested ++once lua pcall(vim.api.nvim_win_close, " .. winnr .. ", true)" + string.format("autocmd %s <buffer> ++once lua pcall(vim.api.nvim_win_close, %d, true)", unpack(close_events), winnr) ) - vim.lsp.util.close_preview_autocmd(close_events, winnr) return bufnr, winnr end @@ -73,10 +72,6 @@ local function preview_location_callback(result) end end -local function preview_location_callback_old_signature(_, _, result) - return preview_location_callback(result) -end - local function preview_location_callback_new_signature(_, result) return preview_location_callback(result) end @@ -136,10 +131,7 @@ function M.Peek(what) else -- Make a new request and then create the new window in the callback local params = vim.lsp.util.make_position_params() - local preview_callback = preview_location_callback_old_signature - if vim.fn.has "nvim-0.5.1" > 0 then - preview_callback = preview_location_callback_new_signature - end + local preview_callback = preview_location_callback_new_signature local success, _ = pcall(vim.lsp.buf_request, 0, "textDocument/" .. what, params, preview_callback) if not success then print( |