Closed daUnknownCoder closed 2 months ago
opts
is no longer passed so you need to remove that from current_line_blame_formatter
.
https://github.com/lewis6991/gitsigns.nvim/commit/d03a1c9a1045122823af97e351719227ed3718eb will now also include the error in the message.
opts
is no longer passed so you need to remove that fromcurrent_line_blame_formatter
.
so what should i use instead of opts?
can you send me the refactored code?
current_line_blame_formatter = function(name, blame_info, opts)
if blame_info.author == name then
blame_info.author = "You"
end
local text
if blame_info.author == "Not Committed Yet" then
text = blame_info.author
else
local date_time
if opts.relative_time then
date_time = require("gitsigns.util").get_relative_time(tonumber(blame_info["author_time"]))
else
date_time = os.date("%R | %x", tonumber(blame_info["author_time"]))
end
text = string.format("%s, %s - %s", blame_info.author, date_time, blame_info.summary)
end
return { { icons.ui.GitHub .. " " .. text, "GitSignsCurrentLineBlame" } }
end,
i also saw you mentioned that relative time is the default thing then how to remove it? and i would also like help for:
i also wanna ask if the file is untracked, can we show the blame as
Untracked!
?
ok i got it working by doing this:
current_line_blame_formatter = function(name, blame_info)
if blame_info.author == name then
blame_info.author = "You"
end
local text
if blame_info.author == "Not Committed Yet" then
text = blame_info.author
else
local date_time = require("gitsigns.util").get_relative_time(tonumber(blame_info["author_time"]))
text = string.format("%s, %s - %s", blame_info.author, date_time, blame_info.summary)
end
return { { icons.ui.GitHub .. " " .. text, "GitSignsCurrentLineBlame" } }
end,
but i still wanna want help for
if the file is untracked, can we show the blame as
Untracked!
?
Description
After the ! change, im experiencing this when using the
current_line_blame_formatter
Neovim version
0.10.0
Operating system and version
6.7.9-arch1-1
Expected behavior
i also wanna ask if the file is untracked, can we show the blame as
Untracked!
?Actual behavior
there's a missing icon and it throws it...
current config:
```lua return { "lewis6991/gitsigns.nvim", enabled = vim.fn.executable("git") == 1, event = "LazyFile", keys = { { ";j", "the icons.ui.github -> (" ") is not coming and it throws the issue
Minimal config
Steps to reproduce
i really dont know how to do the minimal config, but using that config into a committed before but has/does not have changes will suffice because its really the problem of line_blame or my config
Gitsigns debug messages
No response
Gitsigns cache
No response