Skip to content

Commit

Permalink
docs(git_status): add missing opt expand_dir (#2824)
Browse files Browse the repository at this point in the history
* docs(git_status): add missing opt `expand_dir`

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

---------

Co-authored-by: Github Actions <actions@github>
  • Loading branch information
jamestrew and Github Actions committed Dec 25, 2023
1 parent 9907dea commit fa4d663
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 28 deletions.
54 changes: 30 additions & 24 deletions doc/telescope.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,8 @@ builtin.git_status({opts}) *telescope.builtin.git_status()*
{git_icons} (table) string -> string. Matches name with icon
(see source code, make_entry.lua
git_icon_defaults)
{expand_dir} (boolean) pass flag `-uall` to show files in
untracked directories (default: true)


builtin.git_stash({opts}) *telescope.builtin.git_stash()*
Expand Down Expand Up @@ -1394,27 +1396,32 @@ builtin.buffers({opts}) *telescope.builtin.buffers()*
{opts} (table) options to pass to the picker

Options: ~
{cwd} (string) specify a working directory to
filter buffers list by
{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)
{cwd_only} (boolean) alias for only_cwd
{sort_lastused} (boolean) Sorts current and last buffer to
the top and selects the lastused
(default: false)
{sort_mru} (boolean) Sorts all buffers after most recent
used. Not just the current and last
one (default: false)
{bufnr_width} (number) Defines the width of the buffer
numbers in front of the filenames
(default: dynamic)
{file_encoding} (string) file encoding for the previewer
{cwd} (string) specify a working directory to
filter buffers list by
{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)
{cwd_only} (boolean) alias for only_cwd
{sort_lastused} (boolean) Sorts current and last buffer to
the top and selects the lastused
(default: false)
{sort_mru} (boolean) Sorts all buffers after most
recent used. Not just the current
and last one (default: false)
{bufnr_width} (number) Defines the width of the buffer
numbers in front of the filenames
(default: dynamic)
{file_encoding} (string) file encoding for the previewer
{sort_buffers} (function) sort fn(bufnr_a, bufnr_b). true if
bufnr_a should go first. Runs
after sorting by most recent (if
specified)


builtin.colorscheme({opts}) *telescope.builtin.colorscheme()*
Expand Down Expand Up @@ -3311,9 +3318,8 @@ actions.to_fuzzy_refine({prompt_bufnr}) *telescope.actions.to_fuzzy_refine()*
{prompt_bufnr} (number) The prompt bufnr


actions.delete_mark({prompt_bufnr}) *telescope.actions.delete_mark()*
Delete the selected mark or all the marks selected using multi
selection.
actions.delete_mark({prompt_bufnr}) *telescope.actions.delete_mark()*
Delete the selected mark or all the marks selected using multi selection.


Parameters: ~
Expand Down
9 changes: 5 additions & 4 deletions lua/telescope/builtin/__git.lua
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,13 @@ git.status = function(opts)
return
end

local args = { "status", "--porcelain=v1", "--", "." }

local gen_new_finder = function()
local expand_dir = vim.F.if_nil(opts.expand_dir, true)
local git_cmd = git_command({ "status", "--porcelain=v1", "--", "." }, opts)
if expand_dir then
table.insert(git_cmd, #git_cmd - 1, "-u")
if vim.F.if_nil(opts.expand_dir, true) then
table.insert(args, #args - 1, "-uall")
end
local git_cmd = git_command(args, opts)
opts.entry_maker = vim.F.if_nil(opts.entry_maker, make_entry.gen_from_git_status(opts))
return finders.new_oneshot_job(git_cmd, opts)
end
Expand Down
1 change: 1 addition & 0 deletions lua/telescope/builtin/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ builtin.git_branches = require_on_exported_call("telescope.builtin.__git").branc
---@field use_file_path boolean: if we should use the current buffer git root (default: false)
---@field use_git_root boolean: if we should use git root as cwd or the cwd (important for submodule) (default: true)
---@field git_icons table: string -> string. Matches name with icon (see source code, make_entry.lua git_icon_defaults)
---@field expand_dir boolean: pass flag `-uall` to show files in untracked directories (default: true)
builtin.git_status = require_on_exported_call("telescope.builtin.__git").status

--- Lists stash items in current repository
Expand Down

0 comments on commit fa4d663

Please sign in to comment.