summaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'plugin')
-rw-r--r--plugin/40-colors.lua7
-rw-r--r--plugin/50-lsp.lua18
2 files changed, 25 insertions, 0 deletions
diff --git a/plugin/40-colors.lua b/plugin/40-colors.lua
index 21c93e7..6e3e59d 100644
--- a/plugin/40-colors.lua
+++ b/plugin/40-colors.lua
@@ -58,10 +58,17 @@ local function adjust_highlight()
vim.api.nvim_set_hl(0, "TabLineSel", { bg = "#edffd5" })
vim.api.nvim_set_hl(0, "Cursorline", { bg = "#edffd5" })
vim.api.nvim_set_hl(0, "NormalFloat", { bg = solarized_colors.base2 })
+ -- render-markdown links Bullet -> Normal (an explicit bg). The custom
+ -- NormalFloat bg above then differs from that, so bullets show a
+ -- mismatched box in popups. Give the glyph Normal's fg but NO bg so it
+ -- stays transparent and adopts whatever window backs it (Normal in
+ -- buffers, NormalFloat in popups).
+ vim.api.nvim_set_hl(0, "RenderMarkdownBullet", { fg = solarized_colors.base00 })
elseif vim.o.background == "dark" then
vim.api.nvim_set_hl(0, "TabLineSel", { bg = "#043624" })
vim.api.nvim_set_hl(0, "Cursorline", { bg = "#043624" })
vim.api.nvim_set_hl(0, "NormalFloat", { bg = solarized_colors.base02 })
+ vim.api.nvim_set_hl(0, "RenderMarkdownBullet", { fg = solarized_colors.base0 })
end
end
end
diff --git a/plugin/50-lsp.lua b/plugin/50-lsp.lua
index 938cc64..7f62dae 100644
--- a/plugin/50-lsp.lua
+++ b/plugin/50-lsp.lua
@@ -15,6 +15,24 @@ vim.pack.add({ "https://github.com/neovim/nvim-lspconfig" })
vim.api.nvim_create_user_command("LspInspect", inspect_lsp, { desc = "Inspect LSP client" })
+-- Widen hover / signature-help popups so long signatures don't wrap as much.
+-- Both go through the single built-in `vim.lsp.util.open_floating_preview`,
+-- so we wrap that one function instead of every call site:
+-- 1. Save the original into a local (the only remaining reference to it).
+-- 2. Overwrite the table field with our function; Neovim resolves the call
+-- through that field, so it now reaches ours transparently.
+-- 3. Inject `max_width` only when the caller didn't set one (the 120-col
+-- Lua/Markdown line-length convention), then forward every argument
+-- unchanged to the original and return its results.
+-- The float is still clamped to the available screen space, so a signature
+-- longer than the popup can fit will still wrap (just less often).
+local open_floating_preview = vim.lsp.util.open_floating_preview
+function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
+ opts = opts or {}
+ opts.max_width = opts.max_width or 120
+ return open_floating_preview(contents, syntax, opts, ...)
+end
+
-- Enable LSP server capabilities if available when attaching, see `:help lsp-attach`
vim.api.nvim_create_autocmd("LspAttach", {
desc = "Enable LSP capabilities",