Commit graph

548 commits

Author SHA1 Message Date
Folke Lemaitre
e8de28b56e
feat(picker): opts.focus can be used to set default focus window. opts.enter if picker should be focused on enter. Closes #1162 2025-02-14 07:09:51 +01:00
Folke Lemaitre
e3ead3c648
fix(dashboard): allow dashboard to be the main editor window 2025-02-14 07:04:56 +01:00
Folke Lemaitre
121e74e4a5
fix(picker.list): keep existing target if it exists unless force = true. Closes #1152
Some checks failed
CI / ci (push) Failing after 0s
2025-02-13 22:11:05 +01:00
Folke Lemaitre
031f9e96fb
fix(picker): opts.focus = false now works again 2025-02-13 22:11:04 +01:00
Salomon Popp
885c1409e8
fix(picker.explorer): ensure diagnostics can be disabled (#1145)
Some checks failed
CI / ci (push) Failing after 0s
## Description

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

`opts.diagnostics=false` was being ignored by `Snacks.picker.explorer`

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

I didn't create an issue for it

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
2025-02-13 21:07:41 +01:00
Folke Lemaitre
e390713ac6
fix(picker): save toggles for resume. Closes #1085 2025-02-13 20:44:12 +01:00
Folke Lemaitre
be781f9fcb
fix(picker.list): list:view should never transform reverse. Closes #1016 2025-02-13 20:38:16 +01:00
Folke Lemaitre
b39a3ba40a
fix(picker.git): better handling of multi file staging 2025-02-13 20:27:29 +01:00
Folke Lemaitre
0e363177bd
fix(picker.list): dont transform with reverse for resolving target. Closes #1142 2025-02-13 20:27:08 +01:00
Folke Lemaitre
001f3002ca
feat(image): markdown inline image preview. opts.image must be enabled and terminal needs support 2025-02-13 18:03:33 +01:00
Steven Arcangeli
4c3bfa29f3
fix(picker): vim.ui.select callback is called when canceling selection (#1115)
## Description

From the docs on `:help vim.ui.select`
```
      • {on_choice}  (`fun(item: any?, idx: integer?)`) Called once the user
                     made a choice. `idx` is the 1-based index of `item`
                     within `items`. `nil` if the user aborted the dialog.
```

Right now the behavior will call `on_choice` if the user confirmed a
selection, but will not be called at all if the user explicitly or
implicitly closes the picker. As a plugin author, I rely on the
guarantee that if I call `vim.ui.select`, the callback _will_ be called
either with a value or with a nil.

I just added the simplest, dumbest possible fix for this that prevents
double-calling the callback.

## Related Issue(s)

N/A

## Screenshots

N/A
2025-02-13 17:52:20 +01:00
Folke Lemaitre
e5960d8e32
fix(picker.preview): work-around for Neovim's messy window-local options (that are never truly local). Closes #1100 2025-02-13 16:48:33 +01:00
Folke Lemaitre
89b3ce11ca
fix(picker.preview): update titles on layout update. Closes #1113 2025-02-13 14:06:30 +01:00
Folke Lemaitre
d07e7ac620
fix(picker.list): don't return non-matching items. Closes #1133 2025-02-13 14:06:30 +01:00
max397574
f200b3f6c8
feat(picker): allow complex titles (#1112)
fixes https://github.com/folke/snacks.nvim/issues/1111

## Description

Allows more customization of the title

## Related Issue(s)

Fixes #1111 

## Screenshots


![image](https://github.com/user-attachments/assets/4244e94e-a321-4a9b-a0a0-28f010a7efcb)

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2025-02-13 12:22:56 +01:00
Folke Lemaitre
1219f5e43b
fix(picker): nil on :quit. Closes #1107 2025-02-13 12:07:56 +01:00
Salomon Popp
c0481ab0b6
feat(picker): add LSP symbol range to result item (#1123)
## Description

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

this adds an attribute for the range of the LSP symbol to each picker
item.

## Related Issue(s)

Fixes #1057 

having access to the range of the LSP symbol (i.e. the whole context of
classes and methods) would be tremendously helpful for my solution in
https://github.com/folke/snacks.nvim/issues/1057#issuecomment-2652052218.
Currently the picker items only have a `loc` attribute which holds the
range of the symbol identifier, i.e. the class/method name.

---

perhaps in a followup we could use the range to highlight the symbol
context, similar to how trouble.nvim does it

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
2025-02-13 12:04:55 +01:00
Folke Lemaitre
f6a807da6d
feat(picker.actions): option to disable notify for yank action. Closes #1117 2025-02-13 11:59:24 +01:00
Folke Lemaitre
eae55e7ca3
fix(picker.actions): reverse prev/next on select with a reversed list layout. Closes #1124 2025-02-13 11:55:37 +01:00
Folke Lemaitre
f8bc1192cb
fix(picker.list): reset preview when no results. Closes #1133 2025-02-13 11:49:51 +01:00
Folke Lemaitre
e326de9e0c
fix(picker.actions): check that plugin exists before loading it in help. Closes #1134 2025-02-13 11:43:07 +01:00
Folke Lemaitre
96796db21e
fix(picker): update titles last on show. Closes #1113 2025-02-13 11:41:00 +01:00
Folke Lemaitre
1491b543ef
fix(picker.actions): don't delete empty buffer when its in another tabpage. Closes #1005
Some checks failed
CI / ci (push) Failing after 0s
2025-02-12 18:48:45 +01:00
Iordanis Petkakis
c61f9eb286
feat(treesitter): add tree boolean to toggle on/off tree symbols (#1105)
## Description
Adds a `opts.tree` boolean option for treesitter picker to toggle on/off
tree symbols
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

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

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
2025-02-12 13:18:37 +01:00
Folke Lemaitre
95a300ebaa
refactor(proc): better proc debug 2025-02-12 08:21:22 +01:00
Folke Lemaitre
b94926e5cc
fix(picker.proc): make sure to emit the last line when done. Closes #1095 2025-02-12 07:32:42 +01:00
Folke Lemaitre
d870f16453
feat(picker.proc): added proc debug mode 2025-02-12 07:32:42 +01:00
Folke Lemaitre
a8dda993e5
fix(picker.notifications): close on confirm. Closes #1092 2025-02-12 07:05:48 +01:00
Folke Lemaitre
76f6e4f81c
fix(picker.highlights): close on confirm. Closes #1096 2025-02-12 07:04:13 +01:00
Folke Lemaitre
ab1889c35b
feat(explorer): opts.include and opts.exclude. Closes #1068 2025-02-11 22:22:04 +01:00
Folke Lemaitre
97dcd9c168
feat(picker.util): lua globber 2025-02-11 22:22:04 +01:00
Folke Lemaitre
910437f145
feat(picker.preview): allow passing additional args to the git preview command 2025-02-11 20:12:26 +01:00
Folke Lemaitre
336798345c
fix(picker.highlight): lower case treesitter parser name 2025-02-11 20:02:50 +01:00
Folke Lemaitre
0dab071dba
fix(layout): just hide any layouts below a backdrop. easier and looks better. 2025-02-11 19:53:20 +01:00
Folke Lemaitre
c1f93e25bb
fix(picker.preview): preview for uris. Closes #1075 2025-02-11 13:49:38 +01:00
folke
7cbecf9147 chore(build): auto-generate docs 2025-02-11 12:42:34 +00:00
Folke Lemaitre
0d4aa98cea
feat(picker): added lsp_config source 2025-02-11 13:41:32 +01:00
Folke Lemaitre
6c58b67890
feat(picker.config): better source field spec 2025-02-11 13:41:32 +01:00
Folke Lemaitre
62c2c62671
fix(picker.preview): fix newlines before setting lines of a buffer 2025-02-11 13:41:32 +01:00
Folke Lemaitre
5d42c7e5e4
feat(picker.util): utility function to get all bins on the PATH 2025-02-11 13:41:32 +01:00
Folke Lemaitre
d607d2e050
fix(picker.lsp): only sort when not getting workspace symbols. Closes #1071 2025-02-11 10:18:20 +01:00
Folke Lemaitre
34dd83c257
fix(picker.config): use <c-w>HJKL to move float to far left/bottom/top/right. Only in normal mode. 2025-02-10 22:34:53 +01:00
Folke Lemaitre
fcb2f508dd
fix(picker.input): prevent save dialog 2025-02-10 22:06:09 +01:00
Folke Lemaitre
9ab6637df0
fix(picker.actions): use vim.v.register instead of + as default. 2025-02-10 20:47:31 +01:00
Folke Lemaitre
01efab2ddb
feat(picker): each window can now be toggled (also input), hidden and have auto_hide 2025-02-10 20:26:14 +01:00
Folke Lemaitre
593adccd90
refactor(picker): refactor all the things 2025-02-10 20:26:14 +01:00
Folke Lemaitre
3841a8705a
fix(picker.help): make sure plugin is loaded for which we want to view the help 2025-02-10 14:56:50 +01:00
Folke Lemaitre
0d5b106d4e
feat(image): health checks 2025-02-10 12:10:57 +01:00
Folke Lemaitre
8272c1c66f
fix(all): better support for opening windows / pickers / ... on multiple tab pages. Closes #1043 2025-02-10 11:24:13 +01:00
Folke Lemaitre
12a7ea28b9
feat(picker.files): added ft option to filter by extension(s) 2025-02-10 10:27:34 +01:00