Commit graph

1292 commits

Author SHA1 Message Date
Folke Lemaitre
08f3c32c7d feat(picker.format): better path formatting for directories 2025-01-30 17:56:14 +01:00
Folke Lemaitre
046653a4f1 fix(picker): better handling of win Enter/Leave mostly for split layouts 2025-01-30 17:56:14 +01:00
Folke Lemaitre
118d90899d feat(picker): picker:iter() now also returns idx 2025-01-30 17:56:14 +01:00
Folke Lemaitre
da08379205 feat(picker.list): added support for setting a cursor/topline target for the next render. Target clears when reached, or when finders finishes. 2025-01-30 17:56:14 +01:00
Folke Lemaitre
696d1981b1 fix(layout): make sure split layouts are still visible when a float layout with backdrop opens 2025-01-30 17:56:14 +01:00
Folke Lemaitre
b50d697ce4 fix(layout): better update check for split layouts 2025-01-30 17:56:14 +01:00
Folke Lemaitre
3f43026f57 fix(picker.layout): fix list cursorline when layout updates 2025-01-30 17:56:14 +01:00
Folke Lemaitre
b479f10b24 fix(picker): don't destroy active pickers (only an issue when multiple pickers were open) 2025-01-30 17:56:14 +01:00
Folke Lemaitre
b37f368a81 feat(picker.config): added opts.config which can be a function that can change the resolved options 2025-01-30 17:56:14 +01:00
Folke Lemaitre
69c013e1b2 fix(picker.config): normalize opts.cwd 2025-01-30 17:56:14 +01:00
Folke Lemaitre
5a8d79847b feat(picker): opts.focus = "input"|"list"|false to configure what to focus (if anything) when showing the picker 2025-01-30 17:56:14 +01:00
Folke Lemaitre
7f0cde31c4 refactor(picker.input): do startinsert when entering the input window 2025-01-30 17:56:14 +01:00
Folke Lemaitre
9d8c277beb feat(rename): optional file, on_rename for Snacks.rename.rename_file() 2025-01-30 17:56:14 +01:00
Folke Lemaitre
b6cf033051 feat(picker): opening a picker with the same source as an active picker, will close it instead (toggle) 2025-01-30 17:56:14 +01:00
Folke Lemaitre
92710dfb0b fix(picker.lsp): remove symbol detail from search text. too noisy 2025-01-30 17:56:14 +01:00
Folke Lemaitre
3e1dc300cc feat(picker.files): allow forcing the files finder to use a certain cmd 2025-01-30 17:56:14 +01:00
PFiS
6effbcdff1
fix(win): error when enabling padding with listchars="" (#786)
Some checks failed
CI / ci (push) Failing after 0s
## Description

`vim.split` would split `""` into `{ "" }`, causing `table.concat` to
output `",eol: "`.

Resolved by using `vim.tbl_filter` to filter out empty strings before
applying `table.concat`.
2025-01-29 21:07:36 +01:00
Folke Lemaitre
390f017c3b
fix(picker.score): scoring closer to fzf. See #787 2025-01-29 21:04:24 +01:00
Folke Lemaitre
b45d0e0357
fix(matcher.score): correct prev_class for transition bonusses when in a gap. Fixes #787 2025-01-29 18:49:44 +01:00
Folke Lemaitre
215ae72daa
fix(picker.layout): make split layouts work in layout preview 2025-01-29 18:19:58 +01:00
Folke Lemaitre
5496c22b6e
feat(picker): added support for split layouts to picker (sidebar and ivy_split) 2025-01-29 18:06:13 +01:00
Folke Lemaitre
ad8f16632c
feat(picker): added support to keep the picker open when focusing another window (auto_close = false) 2025-01-29 18:05:48 +01:00
Folke Lemaitre
6da592e130
feat(layout): added support for split layouts (root box can be a split) 2025-01-29 18:01:30 +01:00
Folke Lemaitre
2f396b341d
fix(dashboard): prevent starting picker twice when no session manager. Fixes #783
Some checks failed
CI / ci (push) Failing after 0s
2025-01-29 13:09:02 +01:00
Folke Lemaitre
d70af2d253
fix(picker.select): allow configuring vim.ui.select with the select source. Closes #776 2025-01-29 12:49:20 +01:00
Folke Lemaitre
460b58bdbd
fix(picker.preview): don't error on invalid start positions for regex. Fixes #784 2025-01-29 12:07:48 +01:00
Folke Lemaitre
dda6230879
chore(picker.matcher): cleanup 2025-01-29 07:12:15 +01:00
soulsoiledit
5ff2ad320b
fix(dashboard): don't override user configuration (#774)
## Description

When `picker` is enabled, the original line removes it from the table
and reinserts it as the first element, preventing the user configuration
in `preset.picker` from being used as the picker. This change inserts it
as the second element instead.
2025-01-29 06:55:44 +01:00
Folke Lemaitre
6c9f866b31
fix(picker.actions): proper cr check 2025-01-29 06:49:50 +01:00
Folke Lemaitre
9b80e444f5
feat(picker.actions): added separate hl group for pick win current 2025-01-29 06:42:12 +01:00
Folke Lemaitre
4a1d189f9f
fix(picker.actions): stop pick_win when no target and only unhide when picker wasn't stopped 2025-01-29 06:32:12 +01:00
Folke Lemaitre
dcd3bc0329
fix(picker): split edit_win in {"pick_win", "jump"} 2025-01-29 00:14:14 +01:00
Folke Lemaitre
e960010496
fix(picker.git): better stash pattern. Closes #775 2025-01-29 00:07:58 +01:00
Folke Lemaitre
2ba5be8491
feat(picker): added edit_win action bound to ctrl+enter to pick a window and edit 2025-01-28 23:55:41 +01:00
Folke Lemaitre
dfaa18d1c7
perf(picker.matcher): optimize matcher priorities and skip items that can't match for pattern subset 2025-01-28 22:57:18 +01:00
Folke Lemaitre
04e2995bbf
fix(picker.preview): don't enable numbers when minimal=true 2025-01-28 19:32:07 +01:00
Folke Lemaitre
32cffd2e60
feat(picker): added notifications picker. Closes #738 2025-01-28 17:16:32 +01:00
Folke Lemaitre
7da5d953f9
style(picker.git): luals annotations 2025-01-28 16:32:19 +01:00
Folke Lemaitre
3cdebee880
fix(picker.git): default to git root for git_files. Closes #751 2025-01-28 16:29:26 +01:00
Folke Lemaitre
ea838e2838
fix(picker.preview): only show binary message when binary and no ft. Closes #729 2025-01-28 16:18:00 +01:00
Folke Lemaitre
2b15357c25
fix(picker.git): ignore autostash 2025-01-28 16:06:21 +01:00
Folke Lemaitre
bb3db117a4
feat(picker): added git_stash picker. Closes #762 2025-01-28 16:05:30 +01:00
ycycyyc
1a5a0871c8
fix(picker.resume): fix picker is nil (#772)
## Description
 `Picker.resume` sometimes get an error:
```
Error executing vim.schedule lua callback: ...zy_178550383/snacks.nvim/lua/snacks/picker/core/list.lua:183: attempt to index field 'picker' (a nil value)
stack traceback:
        ...zy_178550383/snacks.nvim/lua/snacks/picker/core/list.lua:183: in function '_move'
        ...zy_178550383/snacks.nvim/lua/snacks/picker/core/list.lua:203: in function 'move'
        ...zy_178550383/snacks.nvim/lua/snacks/picker/core/list.lua💯 in function 'view'
        ..._178550383/snacks.nvim/lua/snacks/picker/core/picker.lua:341: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>
```
## Steps to reproduce
1. `Snacks.picker.grep({live=false, search='a'})`. ## run in a big repro
2. close picker immediately before `rg` stops running
3. run `resume`
4.  close picker and get an error
2025-01-28 14:25:39 +01:00
Folke Lemaitre
5f32414dd6
perf(picker.recent): correct generator for old files 2025-01-28 14:19:47 +01:00
Folke Lemaitre
4e30ff0f1e
fix(picker.multi): apply source filter settings for multi source pickers. See #761 2025-01-28 14:19:25 +01:00
Iordanis Petkakis
ac20c6ff5d
fix(filter): insert path from filter.paths into self.paths (#761)
## Description
Here we see that we insert the paths into `filter` instead of
`self.paths`
b96bd540f7/lua/snacks/picker/core/filter.lua (L34-L44)
and later on here
b96bd540f7/lua/snacks/picker/core/filter.lua (L90-L94)
we check `self.paths` to get the path.

This was causing issues to not correctly filter out the already defined
paths and I was able to see, for example the scratch buffer files in the
pickers.
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)
None
<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
2025-01-28 13:35:44 +01:00
Folke Lemaitre
e4ae9e3229
fix(picker.filter): proper cwd check. See #757 2025-01-28 13:32:01 +01:00
Folke Lemaitre
b1f4f99a51
fix(bufdelete): invalid lua 2025-01-28 13:24:01 +01:00
Folke Lemaitre
1069d78334
fix(picker.util): proper cwd check for paths. Fixes #754. See #757 2025-01-28 13:21:00 +01:00
Folke Lemaitre
ea44a2d4c2
fix(picker.config): fix wrong opts.cwd = true config. Closes #757 2025-01-28 13:21:00 +01:00