feat: add support for bufnr in column rendering functions (#575)

This is primarily for user-defined custom columns, which may want access
to the current path or similar information
This commit is contained in:
Ian Wright 2025-02-12 19:49:43 -05:00 committed by GitHub
parent abbfbd0dbc
commit 8abc58b038
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View file

@ -747,7 +747,7 @@ M.format_entry_cols = function(entry, column_defs, col_width, adapter, is_hidden
table.insert(cols, id_key)
-- Then add all the configured columns
for i, column in ipairs(column_defs) do
local chunk = columns.render_col(adapter, column, entry)
local chunk = columns.render_col(adapter, column, entry, bufnr)
local text = type(chunk) == "table" and chunk[1] or chunk
---@cast text string
col_width[i + 1] = math.max(col_width[i + 1], vim.api.nvim_strwidth(text))