feat: Adds shorten_path, show_all_buffers opts and fixes alignment (buffers builtin) (#32)

This commit is contained in:
Simon Hauser
2020-09-12 23:07:37 +02:00
committed by GitHub
parent 3a9b25e6bf
commit 4852d027d0
4 changed files with 54 additions and 24 deletions

View File

@@ -404,13 +404,19 @@ builtin.fd = builtin.find_files
builtin.buffers = function(opts)
opts = opts or {}
local buffers = filter(function(b)
local buffers = filter(function(b)
return
vim.api.nvim_buf_is_loaded(b)
(opts.show_all_buffers
or vim.api.nvim_buf_is_loaded(b))
and 1 == vim.fn.buflisted(b)
end, vim.api.nvim_list_bufs())
if not opts.bufnr_width then
local max_bufnr = math.max(unpack(buffers))
opts.bufnr_width = #tostring(max_bufnr)
end
pickers.new(opts, {
prompt = 'Buffers',
finder = finders.new_table {