refactor: add vim._resolve_bufnr

This commit is contained in:
Lewis Russell
2024-12-07 13:05:05 +00:00
committed by Lewis Russell
parent b52ffd0a59
commit 668d2569b4
13 changed files with 61 additions and 121 deletions

View File

@@ -716,7 +716,7 @@ end
--- @param bufnr integer Buffer handle, or 0 for the current buffer
--- @param opts? vim.lsp.completion.BufferOpts
function M.enable(enable, client_id, bufnr, opts)
bufnr = (bufnr == 0 and api.nvim_get_current_buf()) or bufnr
bufnr = vim._resolve_bufnr(bufnr)
if enable then
enable_completions(client_id, bufnr, opts or {})