Move files out of their respective fs structure into program dirs in root and symlink dotfils using HM.
This commit is contained in:
parent
10bab010b7
commit
fb2adb4547
72 changed files with 9 additions and 0 deletions
35
nvim/lua/inlay_hints_handler.lua
Normal file
35
nvim/lua/inlay_hints_handler.lua
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
local M = {}
|
||||
|
||||
M.hints_active = true
|
||||
M.buffers = {}
|
||||
|
||||
function M.add_buffer(bufnr)
|
||||
table.insert(M.buffers, bufnr)
|
||||
|
||||
vim.lsp.inlay_hint.enable(M.hints_active, { bufnr = bufnr })
|
||||
vim.api.nvim_create_autocmd({ "BufDelete", "BufUnload" }, {
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
for i, buffer in ipairs(M.buffers) do
|
||||
if buffer == bufnr then
|
||||
table.remove(M.buffers, i)
|
||||
break
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
function M.disable()
|
||||
for _, bufnr in ipairs(M.buffers) do
|
||||
vim.lsp.inlay_hint.enable(false, { bufnr = bufnr })
|
||||
end
|
||||
end
|
||||
|
||||
function M.restore()
|
||||
for _, bufnr in ipairs(M.buffers) do
|
||||
vim.lsp.inlay_hint.enable(M.hints_active, { bufnr = bufnr })
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
Loading…
Add table
Add a link
Reference in a new issue