mirror of
https://github.com/Ascyii/nvim.git
synced 2026-01-01 04:04:24 -05:00
Custom borders for hovering and diagnostics
This commit is contained in:
21
lua/utils/after.lua
Normal file
21
lua/utils/after.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
local function rounded_border()
|
||||
return { '╭', '─', '╮', '│', '╯', '─', '╰', '│' }
|
||||
end
|
||||
|
||||
-- Buffer the original fuction
|
||||
local nvim_open_win = vim.api.nvim_open_win
|
||||
|
||||
-- Set color to a slight gray
|
||||
vim.api.nvim_set_hl(0, 'FloatBorder', { bg = 'None', fg = '#a0a0a0' })
|
||||
vim.api.nvim_set_hl(0, 'NormalFloat', { bg = 'None' })
|
||||
|
||||
-- Border overwrite
|
||||
vim.api.nvim_open_win = function(buf, enter, opts)
|
||||
opts = opts or {}
|
||||
|
||||
if opts.border == nil then
|
||||
opts.border = rounded_border()
|
||||
end
|
||||
|
||||
return nvim_open_win(buf, enter, opts)
|
||||
end
|
||||
Reference in New Issue
Block a user