neovim: Fix compatibility with newer plugin versions

pull/64/head
Simon Bruder 2022-05-31 14:40:18 +02:00
parent f4d2bdfb4a
commit 12be176ecc
Signed by: simon
GPG Key ID: 8D3C82F9F309F8EC
1 changed files with 5 additions and 6 deletions

View File

@ -147,7 +147,7 @@ cmp.setup {
snippet = {
expand = function(args) luasnip.lsp_expand(args.body) end,
},
mapping = {
mapping = cmp.mapping.preset.insert({
['<C-d>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
['<C-e>'] = cmp.mapping({ i = cmp.mapping.abort(), c = cmp.mapping.close() }),
@ -174,7 +174,7 @@ cmp.setup {
fallback()
end
end, { 'i', 's' }),
},
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
@ -182,7 +182,7 @@ cmp.setup {
}, {
{
name = 'buffer',
opts = {
option = {
keyword_pattern = [[\k\+]], -- allow unicode multibyte characters
},
}
@ -202,9 +202,8 @@ vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(vim.lsp.diagn
update_in_insert = true, -- update suggestions in insert mode
})
for type, icon in pairs({ Error = '', Warning = '', Hint = '', Information = '' }) do
local hl = 'LspDiagnosticsSign' .. type
fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
for type, icon in pairs({ Error = '', Warn = '', Hint = '', Info = '' }) do
fn.sign_define("DiagnosticSign" .. type, { text = icon, texthl = "Diagnostic" .. type })
end
local on_attach = function(client, bufnr)