diff options
| author | jdhao <jdhao@hotmail.com> | 2022-08-14 20:16:00 +0800 |
|---|---|---|
| committer | jdhao <jdhao@hotmail.com> | 2022-08-14 20:16:00 +0800 |
| commit | 2880d7bce353e5e96e8f3f44e38982bf80ba6d69 (patch) | |
| tree | 26d76d3738a2b67732fd8f067e3462d6dc1c8324 /lua/config/lsp.lua | |
| parent | 7e6dd23d37e9c077fa9cde69dab01a6e10a6f4f8 (diff) | |
chore: renaming
Diffstat (limited to 'lua/config/lsp.lua')
| -rw-r--r-- | lua/config/lsp.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua index 1c0fd51..7736ae6 100644 --- a/lua/config/lsp.lua +++ b/lua/config/lsp.lua @@ -21,10 +21,10 @@ local custom_attach = function(client, bufnr) vim.keymap.set("n", "<space>q", function() vim.diagnostic.setqflist({open = true}) end, opts) vim.keymap.set("n", "<space>ca", vim.lsp.buf.code_action, opts) - vim.api.nvim_create_autocmd("CursorHold", { + api.nvim_create_autocmd("CursorHold", { buffer=bufnr, callback = function() - local opts = { + local float_opts = { focusable = false, close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" }, border = 'rounded', @@ -36,11 +36,11 @@ local custom_attach = function(client, bufnr) vim.b.diagnostics_pos = { nil, nil } end - local cursor_pos = vim.api.nvim_win_get_cursor(0) + local cursor_pos = api.nvim_win_get_cursor(0) if (cursor_pos[1] ~= vim.b.diagnostics_pos[1] or cursor_pos[2] ~= vim.b.diagnostics_pos[2]) and #vim.diagnostic.get() > 0 then - vim.diagnostic.open_float(nil, opts) + vim.diagnostic.open_float(nil, float_opts) end vim.b.diagnostics_pos = cursor_pos |
