neovim: Fix compatibility with newer plugin versions
This commit is contained in:
parent
f4d2bdfb4a
commit
12be176ecc
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue