mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
This commit is contained in:
parent
2a06e4ce99
commit
2f2f4c95af
2 changed files with 24 additions and 21 deletions
|
@ -37,8 +37,8 @@ Open the repo of the active file in the browser (e.g., GitHub)
|
|||
end
|
||||
vim.ui.open(url)
|
||||
end,
|
||||
---@type "repo" | "branch" | "file" | "commit"
|
||||
what = "file", -- what to open. not all remotes support all types
|
||||
---@type "repo" | "branch" | "file" | "commit" | "permalink"
|
||||
what = "commit", -- what to open. not all remotes support all types
|
||||
branch = nil, ---@type string?
|
||||
line_start = nil, ---@type number?
|
||||
line_end = nil, ---@type number?
|
||||
|
@ -61,16 +61,19 @@ Open the repo of the active file in the browser (e.g., GitHub)
|
|||
["github%.com"] = {
|
||||
branch = "/tree/{branch}",
|
||||
file = "/blob/{branch}/{file}#L{line_start}-L{line_end}",
|
||||
permalink = "/blob/{commit}/{file}#L{line_start}-L{line_end}",
|
||||
commit = "/commit/{commit}",
|
||||
},
|
||||
["gitlab%.com"] = {
|
||||
branch = "/-/tree/{branch}",
|
||||
file = "/-/blob/{branch}/{file}#L{line_start}-L{line_end}",
|
||||
permalink = "/-/blob/{commit}/{file}#L{line_start}-L{line_end}",
|
||||
commit = "/-/commit/{commit}",
|
||||
},
|
||||
["bitbucket%.org"] = {
|
||||
branch = "/src/{branch}",
|
||||
file = "/src/{branch}/{file}#lines-{line_start}-L{line_end}",
|
||||
permalink = "/src/{commit}/{file}#lines-{line_start}-L{line_end}",
|
||||
commit = "/commits/{commit}",
|
||||
},
|
||||
},
|
||||
|
|
|
@ -596,6 +596,23 @@ Snacks.picker.pick({source = "files", ...})
|
|||
---@field field? 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}
|
||||
|
@ -672,23 +689,6 @@ 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
|
||||
|
@ -2646,8 +2646,6 @@ Snacks.picker.actions.toggle_preview(picker)
|
|||
Snacks.picker.actions.yank(picker, item, action)
|
||||
```
|
||||
|
||||
|
||||
|
||||
## 📦 `snacks.picker.core.picker`
|
||||
|
||||
```lua
|
||||
|
@ -2881,3 +2879,5 @@ Get the word under the cursor or the current visual selection
|
|||
```lua
|
||||
picker:word()
|
||||
```
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue