Commit graph

1292 commits

Author SHA1 Message Date
Folke Lemaitre
c2f06daeca
fix(dashboard): use Snacks.util.icon for icons. Closes #1192 2025-02-15 12:27:37 +01:00
Folke Lemaitre
f311d1c83a
fix(picker.buffers): remove dd to delete buffer from input keymaps. Closes #1193 2025-02-15 12:23:30 +01:00
Folke Lemaitre
c114a0da1a
fix(picker.git): correct root dir for git log 2025-02-15 12:06:25 +01:00
Folke Lemaitre
2e284e23d9
fix(picker.git): apply args to git, and not git grep. 2025-02-15 10:36:38 +01:00
Folke Lemaitre
9c436cb273
fix(picker.git): properly handle file renames for git log. Closes #1154 2025-02-15 08:06:07 +01:00
Folke Lemaitre
7122a03fdf
feat(picker.git): allow passing extra args to git grep. Closes #1184 2025-02-15 07:13:41 +01:00
Folke Lemaitre
72ffb3d1a2
fix(layout): zindex weirdness on stable. Closes #1180
Some checks failed
CI / ci (push) Failing after 0s
2025-02-15 00:45:11 +01:00
Folke Lemaitre
f3cdd02620
fix(picker.lsp): handle invalid lsp kinds. Closes #1182 2025-02-14 22:52:56 +01:00
Folke Lemaitre
ffc6fe3965
feat(picker): default c-t keymap to open in tab 2025-02-14 22:22:46 +01:00
Folke Lemaitre
6d0d2dc2a7
feat(picker): added c-q to list 2025-02-14 22:20:21 +01:00
Folke Lemaitre
c1f4d30325
fix(picker): closed check for show preview. Closes #1181 2025-02-14 22:19:38 +01:00
Folke Lemaitre
4bcd26aca8
fix(image): remove ft check, since we use lang already. Closes #1177 2025-02-14 22:16:20 +01:00
Folke Lemaitre
849d69ba2e
Revert "feat: test"
This reverts commit 520ed85169.
2025-02-14 22:13:38 +01:00
Folke Lemaitre
41e05dcb28
Revert "test"
This reverts commit 538bc3b65a.
2025-02-14 22:13:36 +01:00
Folke Lemaitre
ee9e6179fe
fix(toggle): hide toggle when real keymap does not exist. Closes #378 2025-02-14 22:13:16 +01:00
Folke Lemaitre
538bc3b65a
test 2025-02-14 17:35:24 +01:00
Folke Lemaitre
520ed85169
feat: test 2025-02-14 17:35:15 +01:00
Folke Lemaitre
a23b10e6ca
fix(picker): remove debug 2025-02-14 17:23:00 +01:00
Folke Lemaitre
45a6f8d1ee
feat(picker.lsp): added original symbol to item.item. Closes #1171 2025-02-14 17:22:09 +01:00
Folke Lemaitre
4e10e31398
feat(image): floats in markdown. Closes #1151 2025-02-14 17:19:45 +01:00
Folke Lemaitre
f36c70a912
fix(dashboard): dashboard can be a main editor window 2025-02-14 12:39:19 +01:00
Folke Lemaitre
27256cf989
fix(layout): deep merge instead of shallow merge for window options. Closes #1166 2025-02-14 12:38:45 +01:00
Folke Lemaitre
a5748ea8db
feat(image): added support for remote image viewing. Closes #1156 (#1165)
## Description

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

## Related Issue(s)

<!--
  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-14 11:24:24 +01:00
SheffeyG
7014b91b92
fix(input): add missing hl group for input title (#1164)
Add the missing highlight group for input title.
Before:

![image](https://github.com/user-attachments/assets/600c8886-0547-48f5-b878-5d0482537446)
After:

![image](https://github.com/user-attachments/assets/13bad24f-6f96-41d6-ab3a-0b9001f68ea9)
2025-02-14 08:47:47 +01:00
Folke Lemaitre
243eecaca5
feat(picker.format): opts.formatters.file.use_git_status_hl defaults to true and adds git status hl to filename 2025-02-14 07:39:00 +01:00
Folke Lemaitre
7d350bc0c7
fix(buffers): use " mark for full buffer position when set. Closes #1160 2025-02-14 07:31:28 +01:00
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
7161dc1b57
fix(scroll): added keepjumps 2025-02-13 21:03:33 +01:00
Folke Lemaitre
a3194d9519
perf(scroll): much better/easier/faster method for vertical cursor positioning 2025-02-13 20:54:49 +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
af21ea3ccf
feat(image): custom src resolve function 2025-02-13 19:36:46 +01:00
Folke Lemaitre
2ef63754b9
fix(image): added support for relative paths. Closes #1143 2025-02-13 19:24:13 +01:00
Folke Lemaitre
298499dcb9
fix(image): only load image when the file exists. Closes #1143 2025-02-13 18:44:38 +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
Iordanis Petkakis
2f3f080ede
fix(gitbrowse): previous logic always overwrote 'commit' (#1127)
## Description
The previous logic didn't check for `fields.commit` when checking
whether to switch to `branch` or `repo`, thus `opts.what = "commit"` was
always being overwritten.
<!-- 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-02-13 12:04:09 +01:00
Iordanis Petkakis
369732e65e
feat(toggle): allow user to add custom which-key description (#1121)
## Description
Allows user to add custom which-key description in the `toggle` itself
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

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

## Screenshots

<!-- Add screenshots of the changes if applicable. -->

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2025-02-13 12:03:14 +01:00