Commit graph

1292 commits

Author SHA1 Message Date
Folke Lemaitre
9c0e2d4362
refactor(picker): pass finder context to transform 2025-01-22 23:49:56 +01:00
Folke Lemaitre
5a4b684c0d
feat(picker.filter): Filter arg for filter 2025-01-22 23:49:56 +01:00
Folke Lemaitre
4c2827246a
refactor(picker.proc): make it easier to customize proc finders 2025-01-22 23:49:56 +01:00
Folke Lemaitre
7b85dfc6f6
feat(picker.matcher): frecency and cwd bonus can now be enabled on any picker 2025-01-22 23:49:56 +01:00
Folke Lemaitre
5778234e39
feat(picker.help): add more color to help tags 2025-01-22 23:49:56 +01:00
Folke Lemaitre
caf20764f1
refactor(picker.finder): function signature of finders changed to fun(opts, ctx) 2025-01-22 23:49:56 +01:00
Folke Lemaitre
9db49b7e6c
fix(picker.lsp): make lsp_symbols work for unloaded buffers 2025-01-22 23:49:56 +01:00
Folke Lemaitre
6cbca8adff
fix(picker.lsp): schedule_wrap cancel functions and resume when no clients 2025-01-22 23:49:56 +01:00
Folke Lemaitre
dfcf27e2a9
fix(picker.async): better handling of abort and schedule/defer util function 2025-01-22 23:49:56 +01:00
Folke Lemaitre
2877ce5dcb
refactor(picker): merge functionality of picker:find and picker:match in picker:find 2025-01-22 23:49:56 +01:00
Folke Lemaitre
8006caadb3
fix(picker.lsp): use correct buf/win 2025-01-22 23:49:55 +01:00
Folke Lemaitre
fcceedf473
refactor(picker): move resolving of preview / format to config 2025-01-22 23:49:55 +01:00
Folke Lemaitre
efb6d1f8b8
feat(picker): syntax highlighting for command and search history 2025-01-22 23:49:55 +01:00
Folke Lemaitre
93cca7a4b3
fix(picker.input): correct cursor position in input when cycling / focus. Fixes #688 2025-01-21 18:33:45 +01:00
Folke Lemaitre
3fa2ea3115
perf(picker): gc optims 2025-01-21 18:33:13 +01:00
Folke Lemaitre
c1e2c619b2
fix(picker.async): fixed aborting a coroutine from the coroutine itself. See #665
Some checks failed
CI / ci (push) Failing after 0s
2025-01-21 12:52:36 +01:00
Folke Lemaitre
66d2854ea0
fix(picker.lsp): include_current on Windows. Closes #678 2025-01-21 12:29:39 +01:00
Folke Lemaitre
5429dff1cd
fix(picker.preview): clear buftype for file previews 2025-01-21 12:24:16 +01:00
Folke Lemaitre
317a2093ea
perf(picker): small optims for abort 2025-01-21 12:16:16 +01:00
Folke Lemaitre
964beb1148
fix(picker.util): more relaxed resolve_loc 2025-01-21 09:23:37 +01:00
Folke Lemaitre
cd5eddb1de
fix(picker): better handling of buffers with custom URIs. Fixes #677 2025-01-21 09:18:33 +01:00
Jorge Villalobos
67fbab1bf7
feat(picker.smart): add bufdelete actions from buffers picker (#679)
## Description

This enables the ability to delete buffers directly from the `smart`
picker (or other combined pickers) by adding a check + warning to the
`bufdelete` action (ensuring it only operates on buffer items), and
adding the same `dd` and `<c-x>` mappings as the `buffers` picker.

## Related Issue(s)

TBD... searching.

## Screenshots


https://github.com/user-attachments/assets/6c5c4b5e-74ed-4778-9f31-a714f7da1853
2025-01-21 08:43:37 +01:00
Folke Lemaitre
2cac6678a9
fix(picker.git): parse all detached states. See #671 2025-01-21 08:42:12 +01:00
Folke Lemaitre
2c2ff4caf8
feat(picker): getters and setters for cwd 2025-01-20 20:20:46 +01:00
Kyle Whliang
390f687431
fix(picker.git_branches): handle detached HEAD (#671)
## Description

Handle [detached
HEAD](https://git-scm.com/docs/git-checkout#_detached_head)

- list: display correct information
- preview: without error notification
- action: checkout the commit that HEAD detached at

<!-- 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>
-->

- Fixes #672 

## Screenshots

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

Before:
<img width="1308" alt="image"
src="https://github.com/user-attachments/assets/fad291a3-a730-4a2b-9eb2-4a0edd83d794"
/>

After:
<img width="1038" alt="image"
src="https://github.com/user-attachments/assets/d312579a-e12d-4286-845c-a706d91a6c95"
/>

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2025-01-20 20:03:38 +01:00
Folke Lemaitre
0ed68bdf72
feat(input): persistent history. Closes #591 2025-01-20 18:31:10 +01:00
Folke Lemaitre
ea665ebad1
feat(picker): persistent history. Closes #528 2025-01-20 18:30:52 +01:00
Folke Lemaitre
8d9677fc47
feat(picker.debug): more info about potential leaks 2025-01-20 16:57:49 +01:00
Folke Lemaitre
80db91f03e
feat(input): input history. Closes #591 2025-01-20 16:19:38 +01:00
Folke Lemaitre
23a8668ef0
fix(picker.git): --follow only works for git_log_file. Closes #666 2025-01-20 16:04:41 +01:00
Stefan Boca
81572b5f97
fix(debug.run): schedule only nvim_buf_set_extmark in on_print (#425)
## Description

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

Previously, `get_line` was called from a scheduled function, and would
always return nil, placing the extmark for print output on the wrong
line.

## Screenshots

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

Before:

![image](https://github.com/user-attachments/assets/d493f70a-82c6-4a48-82f6-66beed7b9383)

After:

![image](https://github.com/user-attachments/assets/9a0ec53c-fdfb-4786-b954-86284d3eac54)

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2025-01-20 13:36:34 +01:00
iserpent
f904481439
fix(input): put the cursor right after the default prompt (#549)
## Description

When the input opens, the cursor is placed two columns to the right
after the default prompt, but should be one.
The cause is the `vim.api.nvim_win_set_cursor` takes (row, col) with the
base of (1, 0) */I hate this/*

## Related Issue(s)

No related issue created.

## Screenshots

`:lua Snacks.input({ default = "aaa" }, function () end )`
gives the input as "aaa |" (where pipe shows the cursor position)

Co-authored-by: Igor Iatsenko <igor.iatsenko@here.com>
2025-01-20 13:31:44 +01:00
莊加旭 (Max Chuang)
af559349e5
fix(statusline): fix status line cache key (#656)
## Description

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->
-
d972bc0a47
breaks cache key for virtual lines since `0 and 1 or 0` also evaluates
to 1 in lua.

## Related Issue(s)

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

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
2025-01-20 13:26:20 +01:00
Folke Lemaitre
384b9a7a36
fix(picker.preview): disable relativenumber by default. Closes #664 2025-01-20 13:13:52 +01:00
Folke Lemaitre
2b38a19dc9
feat(notifier) added opts.filter to filter out unwanted notifications. Closes #431 2025-01-20 13:08:14 +01:00
Folke Lemaitre
985ada3c14
fix(scope): parse treesitter injections. Closes #430 2025-01-20 13:04:22 +01:00
Folke Lemaitre
2abf208f2c
feat(terminal): close terminals on ExitPre. Fixes #419 2025-01-20 13:02:13 +01:00
Folke Lemaitre
daa575e3cd
fix(notifier): added SnacksNotifierMinimal. Closes #410 2025-01-20 12:49:41 +01:00
Folke Lemaitre
3146fd139b
feat(terminal): allow overriding default shell. Closes #450 2025-01-20 12:42:59 +01:00
Folke Lemaitre
627af7342c
fix(indent): use correct hl based on indent. Fixes #422 2025-01-20 12:37:56 +01:00
Folke Lemaitre
32cd34383c
fix(dashboard): added optional filter for recent files 2025-01-20 12:14:54 +01:00
Folke Lemaitre
920a9d28f1
fix(zen): properly handle close 2025-01-20 12:08:52 +01:00
iniw
ba45c280dd
fix(zen): sync cursor with parent window (#547)
## Description

The cursor position is now synchronized between the zen/zoom window and
it's parent.

I'm not sure if this is the best way to achieve that. Initally I wanted
to do set the parent's cursor position only when the zen buffer is
closed, but I couldn't figure out a way to do that.

## Related Issue(s)

Fixes #539
2025-01-20 11:49:34 +01:00
Folke Lemaitre
5e00b0ab27
feat(picker.matcher): new opts.matcher.file_pos which defaults to true to support patterns like file:line:col or file:line. Closes #517. Closes #496. Closes #651 2025-01-20 11:40:06 +01:00
Folke Lemaitre
f0d51ce038
fix(picker.grep): debug 2025-01-20 11:03:53 +01:00
Folke Lemaitre
0ac5605bfb
fix(picker.buffer): unselect on delete. Fixes #653 2025-01-20 10:53:04 +01:00
Folke Lemaitre
8601a8ced3
fix(picker.grep): correctly insert args from pattern. See #601 2025-01-20 10:37:00 +01:00
Folke Lemaitre
6b7705c7ed
fix(picker.util): relax pattern for args 2025-01-20 10:37:00 +01:00
Folke Lemaitre
eebf44a34e
perf(picker): fixed some issues with closed pickers not always being garbage collected 2025-01-20 10:30:45 +01:00
Folke Lemaitre
b59f4ff477
feat(picker.debug): debug option to detect garbage collection leaks 2025-01-20 10:30:45 +01:00