diff options
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( | 
