feat: minor steps on hightlighting

This commit is contained in:
2025-09-09 21:03:39 +02:00
parent 832a9b11b9
commit 89f0df3d60
2 changed files with 9 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
local lineBlame = function(input_file_path, comma_separated_mails)
local ns = vim.api.nvim_create_namespace('line-blame');
local lineBlame = function(input_file_path)
local handler = io.popen("git blame -e " .. input_file_path .. " | awk '{ print $2$6}'")
if handler == nil then
@@ -8,8 +9,8 @@ local lineBlame = function(input_file_path, comma_separated_mails)
local result = handler:read("L")
while result do
for k, v in string.gmatch(result, "%(<(.+)>(%d+)%)") do
print(k)
print(v)
-- print(input_file_path, k, v)
local extid = vim.api.nvim_buf_set_extmark(0, ns, tonumber(v), 0, { end_row = tonumber(v), end_col = 30 ,virt_text = {[ "test", "WildMenu"]}})
end
result = handler:read("L")
end

View File

@@ -1,22 +1,21 @@
local blame = require("./line-blame.lua")
local blame = require("./line-blame")
local defaultList = "one;two"
vim.g.monkeyMailList = defaultList
-- vim.g.monkeyUserList = defaultList
vim.g.monkeyMailList = defaultList
local function setup(opts)
vim.g.monkeyMailList = opts.monkeyMailList
-- vim.g.monkeyUserList = opts.monkeyUserList
end
local function observe()
local function blameCurrentFile()
blame.lineBlame(vim.api.nvim_buf_get_name(0))
end
return {
setup = setup,
observe = observe,
blame = blame.lineBlame
blame = blameCurrentFile
}
-- NOTE: