fix(nvim): pass the buffer number as a parameter

This commit is contained in:
Oliver Davies 2022-01-04 21:38:57 +00:00
parent 1c47a51c8b
commit b80396b0dd
2 changed files with 9 additions and 3 deletions

View file

@ -25,7 +25,7 @@ if not status_ok then
return
end
local function lsp_keymaps()
local function lsp_keymaps(bufnr)
local opts = { noremap = true, silent = true }
local keymap = vim.api.nvim_buf_set_keymap
@ -38,7 +38,7 @@ local function lsp_keymaps()
keymap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
end
M.on_attach = function()
M.on_attach = function(bufnr)
lsp_keymaps(bufnr)
end

View file

@ -2,8 +2,14 @@ return {
settings = {
Lua = {
diagnostics = {
globals = { "vim" }
globals = { "use", "vim" }
},
workspace = {
library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
[vim.fn.stdpath("config") .. "/lua"] = true,
},
},
},
},
}