fix(picker.marks): fix buffer checking (#2287)

This buffer number index is 1.
This commit is contained in:
Eric Wong 2025-10-20 12:37:28 +08:00 committed by GitHub
parent a0df15ebcd
commit ca0858a30a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -74,7 +74,7 @@ function M.marks(opts)
local file = mark.file or bufname
local buf = mark.pos[1] and mark.pos[1] > 0 and mark.pos[1] or nil
local line ---@type string?
if buf and mark.pos[2] > 0 and vim.api.nvim_buf_is_valid(mark.pos[2]) then
if buf and mark.pos[2] > 0 and vim.api.nvim_buf_is_valid(mark.pos[1]) then
line = vim.api.nvim_buf_get_lines(buf, mark.pos[2] - 1, mark.pos[2], false)[1]
end
local label = mark.mark:sub(2, 2)