mirror of https://gitlab.com/baco/dotconf.git
feat: Migrate autocmd in on_attach to pure Lua call
Migrated, following TeeJ_Dv's advice, the auto-command creation to a Lua function. As this auto-command only cares for the on_attach Lua scope, it seems correct to have this one defined as a Lua function instead of the legacy Vimscript.
This commit is contained in:
parent
099f247c2e
commit
82697ea146
|
@ -46,7 +46,13 @@ lua << EOF
|
||||||
local nvim_lsp = require("lspconfig")
|
local nvim_lsp = require("lspconfig")
|
||||||
|
|
||||||
local on_attach = function(client, bufnr)
|
local on_attach = function(client, bufnr)
|
||||||
vim.api.nvim_command("autocmd CursorHoldI <buffer> lua vim.diagnostic.open_float({focusable = false, header = ''})")
|
vim.api.nvim_create_autocmd("CursorHoldI", {
|
||||||
|
buffer = bufnr,
|
||||||
|
callback = function()
|
||||||
|
vim.diagnostic.open_float({ focusable = false, header = "" })
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
||||||
vim.lsp.diagnostic.on_publish_diagnostics, {
|
vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||||
update_in_insert = true,
|
update_in_insert = true,
|
||||||
|
|
Loading…
Reference in New Issue