diff --git a/docs/picker.md b/docs/picker.md index 552e2b75..fb384b90 100644 --- a/docs/picker.md +++ b/docs/picker.md @@ -619,23 +619,6 @@ Snacks.picker.pick({source = "files", ...}) ---@field expr string ``` -```lua ----@alias snacks.Picker.ref (fun():snacks.Picker?)|{value?: snacks.Picker} -``` - -```lua ----@class snacks.picker.Last ----@field cursor number ----@field topline number ----@field opts? snacks.picker.Config ----@field selected snacks.picker.Item[] ----@field filter snacks.picker.Filter -``` - -```lua ----@alias snacks.picker.history.Record {pattern: string, search: string, live?: boolean} -``` - ```lua ---@alias snacks.picker.Extmark vim.api.keyset.set_extmark|{col:number, row?:number, field?:string} ---@alias snacks.picker.Text {[1]:string, [2]:string?, virtual?:boolean, field?:string} @@ -714,6 +697,23 @@ It's a previewer that shows a preview based on the item data. ---@field preview? snacks.win.Config|{} preview window config ``` +```lua +---@alias snacks.Picker.ref (fun():snacks.Picker?)|{value?: snacks.Picker} +``` + +```lua +---@class snacks.picker.Last +---@field cursor number +---@field topline number +---@field opts? snacks.picker.Config +---@field selected snacks.picker.Item[] +---@field filter snacks.picker.Filter +``` + +```lua +---@alias snacks.picker.history.Record {pattern: string, search: string, live?: boolean} +``` + ## 📦 Module ```lua @@ -1066,8 +1066,10 @@ Neovim commands ``` ```lua ----@type snacks.picker.git.Config +---@class snacks.picker.git.branches.Config: snacks.picker.git.Config +---@field all? boolean show all branches, including remote { + all = false, finder = "git_branches", format = "git_branch", preview = "git_log", @@ -2729,6 +2731,8 @@ Snacks.picker.actions.toggle_preview(picker) Snacks.picker.actions.yank(picker, item, action) ``` + + ## 📦 `snacks.picker.core.picker` ```lua @@ -2983,5 +2987,3 @@ Get the word under the cursor or the current visual selection ```lua picker:word() ``` - - diff --git a/lua/snacks/picker/types.lua b/lua/snacks/picker/types.lua index c03bdaa7..43043abd 100644 --- a/lua/snacks/picker/types.lua +++ b/lua/snacks/picker/types.lua @@ -11,7 +11,7 @@ ---@field diagnostics_buffer fun(opts?: snacks.picker.diagnostics.Config|{}): snacks.Picker ---@field explorer fun(opts?: snacks.picker.explorer.Config|{}): snacks.Picker ---@field files fun(opts?: snacks.picker.files.Config|{}): snacks.Picker ----@field git_branches fun(opts?: snacks.picker.git.Config|{}): snacks.Picker +---@field git_branches fun(opts?: snacks.picker.git.branches.Config|{}): snacks.Picker ---@field git_diff fun(opts?: snacks.picker.git.Config|{}): snacks.Picker ---@field git_files fun(opts?: snacks.picker.git.files.Config|{}): snacks.Picker ---@field git_grep fun(opts?: snacks.picker.git.grep.Config|{}): snacks.Picker