fix(git): off-by-one issue in lazygit blame line (#3230)

This commit is contained in:
Felipe Cury 2024-05-19 16:30:03 +09:00 committed by GitHub
parent e346d17812
commit 4208a09df8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -152,7 +152,7 @@ function M.blame_line(opts)
border = "rounded",
}, opts or {})
local cursor = vim.api.nvim_win_get_cursor(0)
local line = cursor[1] - 1
local line = cursor[1]
local file = vim.api.nvim_buf_get_name(0)
local cmd = { "git", "log", "-n", opts.count, "-u", "-L", line .. ",+1:" .. file }
return require("lazy.util").float_cmd(cmd, opts)