Change the show_all_buffers option to true by default for buffers picker (#858)

* show_all_buffers true by default, added docs

* [docgen] Update doc/telescope.txt
skip-checks: true

* fix for docs, used param instead of field oops

* [docgen] Update doc/telescope.txt
skip-checks: true

Co-authored-by: Github Actions <actions@github>
This commit is contained in:
Ben Smith
2021-05-31 02:12:18 +00:00
committed by GitHub
parent 517f4b204b
commit 654b11aa08
3 changed files with 14 additions and 1 deletions

View File

@@ -672,6 +672,15 @@ builtin.buffers({opts}) *builtin.buffers()*
Parameters: ~ Parameters: ~
{opts} (table) options to pass to the picker {opts} (table) options to pass to the picker
Fields: ~
{show_all_buffers} (boolean) if true, show all buffers, including
unloaded buffers (default true)
{ignore_current_buffer} (boolean) if true, don't show the current
buffer in the list (default false)
{only_cwd} (boolean) if true, only show buffers in the
current working directory (default
false)
builtin.colorscheme({opts}) *builtin.colorscheme()* builtin.colorscheme({opts}) *builtin.colorscheme()*
Lists available colorschemes and applies them on `<cr>` Lists available colorschemes and applies them on `<cr>`

View File

@@ -207,6 +207,9 @@ builtin.reloader = require('telescope.builtin.internal').reloader
--- Lists open buffers in current neovim instance, opens selected buffer on `<cr>` --- Lists open buffers in current neovim instance, opens selected buffer on `<cr>`
---@param opts table: options to pass to the picker ---@param opts table: options to pass to the picker
---@field show_all_buffers boolean: if true, show all buffers, including unloaded buffers (default true)
---@field ignore_current_buffer boolean: if true, don't show the current buffer in the list (default false)
---@field only_cwd boolean: if true, only show buffers in the current working directory (default false)
builtin.buffers = require('telescope.builtin.internal').buffers builtin.buffers = require('telescope.builtin.internal').buffers
--- Lists available colorschemes and applies them on `<cr>` --- Lists available colorschemes and applies them on `<cr>`

View File

@@ -563,7 +563,8 @@ internal.buffers = function(opts)
if 1 ~= vim.fn.buflisted(b) then if 1 ~= vim.fn.buflisted(b) then
return false return false
end end
if not opts.show_all_buffers and not vim.api.nvim_buf_is_loaded(b) then -- only hide unloaded buffers if opts.show_all_buffers is false, keep them listed if true or nil
if opts.show_all_buffers == false and not vim.api.nvim_buf_is_loaded(b) then
return false return false
end end
if opts.ignore_current_buffer and b == vim.api.nvim_get_current_buf() then if opts.ignore_current_buffer and b == vim.api.nvim_get_current_buf() then