feat: minor steps on hightlighting
This commit is contained in:
@@ -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}'")
|
local handler = io.popen("git blame -e " .. input_file_path .. " | awk '{ print $2$6}'")
|
||||||
|
|
||||||
if handler == nil then
|
if handler == nil then
|
||||||
@@ -8,8 +9,8 @@ local lineBlame = function(input_file_path, comma_separated_mails)
|
|||||||
local result = handler:read("L")
|
local result = handler:read("L")
|
||||||
while result do
|
while result do
|
||||||
for k, v in string.gmatch(result, "%(<(.+)>(%d+)%)") do
|
for k, v in string.gmatch(result, "%(<(.+)>(%d+)%)") do
|
||||||
print(k)
|
-- print(input_file_path, k, v)
|
||||||
print(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
|
end
|
||||||
result = handler:read("L")
|
result = handler:read("L")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,22 +1,21 @@
|
|||||||
local blame = require("./line-blame.lua")
|
local blame = require("./line-blame")
|
||||||
|
|
||||||
local defaultList = "one;two"
|
local defaultList = "one;two"
|
||||||
vim.g.monkeyMailList = defaultList
|
|
||||||
-- vim.g.monkeyUserList = defaultList
|
-- vim.g.monkeyUserList = defaultList
|
||||||
|
vim.g.monkeyMailList = defaultList
|
||||||
|
|
||||||
local function setup(opts)
|
local function setup(opts)
|
||||||
vim.g.monkeyMailList = opts.monkeyMailList
|
vim.g.monkeyMailList = opts.monkeyMailList
|
||||||
-- vim.g.monkeyUserList = opts.monkeyUserList
|
-- vim.g.monkeyUserList = opts.monkeyUserList
|
||||||
end
|
end
|
||||||
|
|
||||||
local function observe()
|
local function blameCurrentFile()
|
||||||
|
blame.lineBlame(vim.api.nvim_buf_get_name(0))
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
setup = setup,
|
setup = setup,
|
||||||
observe = observe,
|
blame = blameCurrentFile
|
||||||
blame = blame.lineBlame
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- NOTE:
|
-- NOTE:
|
||||||
|
|||||||
Reference in New Issue
Block a user