feat: autocmd created for live updating

This commit is contained in:
2025-09-11 13:17:31 +02:00
parent 2c03780bf5
commit 182c6615ab
2 changed files with 12 additions and 2 deletions

View File

@@ -9,7 +9,7 @@ local setNvimMark = function(line_number, blame_text, blame_highlight, blame_pos
id = line_number + 1, -- cant be 0
virt_text = { { blame_text, blame_highlight } },
virt_text_pos = blame_position,
priority = 700,
priority = 1004,
hl_mode = 'combine',
})
end

View File

@@ -28,9 +28,19 @@ local function clearBlame()
blame.clearBlame()
end
local function enableOnLine()
vim.api.nvim_create_autocmd("CursorMoved", {
callback = function(opts)
clearBlame()
blameCurrentLine()
end,
})
end
return {
setup = setup,
blameLine = blameCurrentLine,
blameFile = blameCurrentFile,
blameClear = clearBlame
blameClear = clearBlame,
enable = enableOnLine
}