From e34db671490ebfdc4268fb83602e1a7e06b91e69 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 29 Oct 2022 00:29:11 +0200 Subject: [PATCH] feat: added preset to set hover docs and signature help border --- README.md | 1 + lua/noice/config/init.lua | 1 + lua/noice/config/preset.lua | 10 ++++++++++ lua/noice/lsp/init.lua | 2 +- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 74b6ab3d..aecdffa6 100644 --- a/README.md +++ b/README.md @@ -248,6 +248,7 @@ Check the [wiki](https://github.com/folke/noice.nvim/wiki/Configuration-Recipes) command_palette = false, -- position the cmdline and popupmenu together long_message_to_split = false, -- long messages will be sent to a split inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help }, throttle = 1000 / 30, -- how frequently does Noice need to check for ui updates? This has no effect when in blocking mode. ---@type NoiceConfigViews diff --git a/lua/noice/config/init.lua b/lua/noice/config/init.lua index 3bb0db77..88fda4ef 100644 --- a/lua/noice/config/init.lua +++ b/lua/noice/config/init.lua @@ -186,6 +186,7 @@ function M.defaults() command_palette = false, -- position the cmdline and popupmenu together long_message_to_split = false, -- long messages will be sent to a split inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help }, throttle = 1000 / 30, -- how frequently does Noice need to check for ui updates? This has no effect when in blocking mode. ---@type NoiceConfigViews diff --git a/lua/noice/config/preset.lua b/lua/noice/config/preset.lua index d6453905..7fbb1963 100644 --- a/lua/noice/config/preset.lua +++ b/lua/noice/config/preset.lua @@ -52,6 +52,16 @@ M.presets = { }, }, }, + lsp_doc_border = { + views = { + hover = { + border = { + style = "rounded", + }, + position = { row = 2, col = 2 }, + }, + }, + }, command_palette = { views = { cmdline_popup = { diff --git a/lua/noice/lsp/init.lua b/lua/noice/lsp/init.lua index 15c931b2..3dca9547 100644 --- a/lua/noice/lsp/init.lua +++ b/lua/noice/lsp/init.lua @@ -60,7 +60,7 @@ function M.setup() require("noice.lsp.progress").setup() end - vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI", "InsertCharPre" }, { + vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI", "InsertEnter" }, { group = group, callback = function() vim.defer_fn(M.on_close, 10)