feat(buffers): add buffers_sort option (#2793)
* refactor: add sort_buffers option to buffers picker * refactor: validate sort_buffers opt is a function
This commit is contained in:
@@ -912,6 +912,10 @@ internal.buffers = function(opts)
|
||||
end)
|
||||
end
|
||||
|
||||
if type(opts.sort_buffers) == "function" then
|
||||
table.sort(bufnrs, opts.sort_buffers)
|
||||
end
|
||||
|
||||
local buffers = {}
|
||||
local default_selection_idx = 1
|
||||
for _, bufnr in ipairs(bufnrs) do
|
||||
|
||||
Reference in New Issue
Block a user