From 2880d7bce353e5e96e8f3f44e38982bf80ba6d69 Mon Sep 17 00:00:00 2001 From: jdhao Date: Sun, 14 Aug 2022 20:16:00 +0800 Subject: [PATCH] chore: renaming --- lua/config/lsp.lua | 8 ++++---- 1 file 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", "q", function() vim.diagnostic.setqflist({open = true}) end, opts) vim.keymap.set("n", "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