Keep support for depracated format syntax in version <= 7
This commit is contained in:
parent
a252a8d543
commit
da7767a1fb
|
@ -29,9 +29,16 @@ local on_attach = function(client, bufnr)
|
|||
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', '<leader>i', function ()
|
||||
vim.lsp.buf.format({timeout_ms=10000,async=false}) -- async=true is strange behavior
|
||||
end, bufopts)
|
||||
-- Keep support for deprecated syntax in vim <= 7
|
||||
if vim.version().major <= 7 then
|
||||
vim.keymap.set('n', '<leader>i', function ()
|
||||
vim.lsp.buf.formatting_sync({timeout_ms=10000})
|
||||
end, bufopts)
|
||||
else
|
||||
vim.keymap.set('n', '<leader>i', function ()
|
||||
vim.lsp.buf.format({timeout_ms=10000,async=false})
|
||||
end, bufopts)
|
||||
end
|
||||
-- Enable aerial support
|
||||
require("aerial").on_attach(client, bufnr)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue