feat(bultin.buffer): add select_current option (#2918)
This commit is contained in:
@@ -949,6 +949,9 @@ internal.buffers = function(opts)
|
||||
local idx = ((buffers[1] ~= nil and buffers[1].flag == "%") and 2 or 1)
|
||||
table.insert(buffers, idx, element)
|
||||
else
|
||||
if opts.select_current and flag == "%" then
|
||||
default_selection_idx = bufnr
|
||||
end
|
||||
table.insert(buffers, element)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -349,6 +349,7 @@ builtin.reloader = require_on_exported_call("telescope.builtin.__internal").relo
|
||||
---@field bufnr_width number: Defines the width of the buffer numbers in front of the filenames (default: dynamic)
|
||||
---@field file_encoding string: file encoding for the previewer
|
||||
---@field sort_buffers function: sort fn(bufnr_a, bufnr_b). true if bufnr_a should go first. Runs after sorting by most recent (if specified)
|
||||
---@field select_current boolean: select current buffer (default: false)
|
||||
builtin.buffers = require_on_exported_call("telescope.builtin.__internal").buffers
|
||||
|
||||
--- Lists available colorschemes and applies them on `<cr>`
|
||||
|
||||
Reference in New Issue
Block a user