diff options
| author | Simon Hauser <Simon-Hauser@outlook.de> | 2020-09-12 23:07:37 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-12 17:07:37 -0400 |
| commit | 4852d027d01f278b6273b4c118bea99ba7155ba5 (patch) | |
| tree | 6280b78bf2a487e4b05deccda1d6c6681ddfb553 /lua/telescope/builtin.lua | |
| parent | 3a9b25e6bf49e24794cfb06d1a2e2585f8de2ca9 (diff) | |
feat: Adds shorten_path, show_all_buffers opts and fixes alignment (buffers builtin) (#32)
Diffstat (limited to 'lua/telescope/builtin.lua')
| -rw-r--r-- | lua/telescope/builtin.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lua/telescope/builtin.lua b/lua/telescope/builtin.lua index 1c3c629..a14c08a 100644 --- a/lua/telescope/builtin.lua +++ b/lua/telescope/builtin.lua @@ -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 { |
