fix(buffers): use " mark for full buffer position when set. Closes #1160

This commit is contained in:
Folke Lemaitre 2025-02-14 07:31:27 +01:00
parent d23fd69fa1
commit 7d350bc0c7
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -25,6 +25,7 @@ function M.buffers(opts, ctx)
name = "[No Name]" .. (vim.bo[buf].filetype ~= "" and " " .. vim.bo[buf].filetype or "")
end
local info = vim.fn.getbufinfo(buf)[1]
local mark = vim.api.nvim_buf_get_mark(buf, '"')
local flags = {
buf == current_buf and "%" or (buf == alternate_buf and "#" or ""),
info.hidden == 1 and "h" or "a",
@ -37,7 +38,7 @@ function M.buffers(opts, ctx)
text = buf .. " " .. name,
file = name,
info = info,
pos = { info.lnum, 0 },
pos = mark[1] ~= 0 and mark or { info.lnum, 0 },
})
end
end