Commit graph

203 commits

Author SHA1 Message Date
Folke Lemaitre
b878caaddc
fix(picker.lsp): use async from ctx 2025-01-23 00:13:45 +01:00
Folke Lemaitre
9c0e2d4362
refactor(picker): pass finder context to transform 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
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
8006caadb3
fix(picker.lsp): use correct buf/win 2025-01-22 23:49:55 +01:00
Folke Lemaitre
3fa2ea3115
perf(picker): gc optims 2025-01-21 18:33:13 +01:00
Folke Lemaitre
66d2854ea0
fix(picker.lsp): include_current on Windows. Closes #678 2025-01-21 12:29:39 +01:00
Folke Lemaitre
317a2093ea
perf(picker): small optims for abort 2025-01-21 12:16:16 +01:00
Folke Lemaitre
2cac6678a9
fix(picker.git): parse all detached states. See #671 2025-01-21 08:42:12 +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
23a8668ef0
fix(picker.git): --follow only works for git_log_file. Closes #666 2025-01-20 16:04:41 +01:00
Folke Lemaitre
f0d51ce038
fix(picker.grep): debug 2025-01-20 11:03:53 +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
d0a0046e37
fix(picker.lsp): lazy resolve item lsp locations. Fixes #650 2025-01-20 09:56:12 +01:00
Folke Lemaitre
83baea06d6
feat(picker.buffer): add filetype to bufname for buffers without name 2025-01-19 23:40:36 +01:00
Folke Lemaitre
70106a7930
fix(picker.buffers): add buf number to text 2025-01-19 22:34:57 +01:00
Folke Lemaitre
781b6f6ab0
feat(picker): added args option for files and grep. Closes #621 2025-01-19 22:01:23 +01:00
Folke Lemaitre
5c45f1c193
feat(picker): added undo picker to navigate the undo tree. Closes #638 2025-01-19 21:54:18 +01:00
Folke Lemaitre
eb0e5b7efe
fix(picker.lsp.symbols): only include filename for search with workspace symbols
Some checks failed
CI / ci (push) Failing after 0s
2025-01-19 18:30:18 +01:00
Folke Lemaitre
79d27f19dc
fix(picker.lsp): added support for single location result 2025-01-19 18:14:06 +01:00
Folke Lemaitre
50f3c3e5b1
feat(picker): added support for live args for grep and files. Closes #601 2025-01-19 17:54:25 +01:00
Folke Lemaitre
348307a82e
feat(picker.lsp): added lsp_workspace_symbols. Supports live search. Closes #473 2025-01-19 17:29:37 +01:00
Folke Lemaitre
8563dfce68
feat(picker): added git_branches picker. Closes #614 2025-01-19 16:24:35 +01:00
Folke Lemaitre
903431903b
fix(picker.git): git log file/line for a file not in cwd. Fixes #616 2025-01-19 14:22:30 +01:00
Folke Lemaitre
b170ced527
feat(picker): added spelling picker. Closes #625 2025-01-19 14:02:18 +01:00
Folke Lemaitre
ee988fa4b0
feat(picker.commands): added builtin commands. Fixes #634 2025-01-19 13:01:26 +01:00
Folke Lemaitre
320a4a62a1
feat(picker.frecency): cleanup old entries from sqlite3 database 2025-01-18 11:35:23 +01:00
Folke Lemaitre
c45a94044b
fix(picker.list): newlines in text. Fixes #607. Closes #580 2025-01-18 10:37:00 +01:00
Folke Lemaitre
a01e0f5368
fix(picker.proc): correct offset for carriage returns. Fixes #599 2025-01-18 09:47:11 +01:00
Folke Lemaitre
74feefc522
feat(picker.smart): better frecency bonus 2025-01-17 23:46:06 +01:00
Kristijan Husak
43c312dfc1
fix(picker): show all files in git status (#586)
## Description

When new folder is created in a git project, and there are files inside,
git status picker only shows the folder without any preview. Adding
`-uall` to the commands lists them all.

## Related Issue(s)



## Screenshots

Before: 

![screenshot_2025_01_17_15_42_14](https://github.com/user-attachments/assets/e556f563-dc63-472e-9543-bc784e6e1a35)

After: 

![screenshot_2025_01_17_15_43_13](https://github.com/user-attachments/assets/d6b6d715-02fd-4c77-b167-5c62058153dc)
2025-01-17 20:41:13 +01:00
Folke Lemaitre
192fb31c4b
feat(picker): added exclude option for files and grep. Closes #581 2025-01-17 14:35:29 +01:00
Folke Lemaitre
c43969dabd
feat(picker): use an sqlite3 database for frecency data when available 2025-01-16 23:59:08 +01:00
Folke Lemaitre
1481a90aff
fix(picker.git): git_file and git_line should only show diffs including the file. Fixes #522 2025-01-16 23:21:49 +01:00
Folke Lemaitre
40d08bd901
fix(picker): preview / lsp / diagnostics positions were wrong; Should all be (1-0) indexed. Fixes #543 2025-01-16 22:56:56 +01:00
Folke Lemaitre
4823f2da65
fix(picker.files): ignore errors since it's not possible to know if the error isbecause of an incomplete pattern. Fixes #551 2025-01-16 22:31:34 +01:00
Folke Lemaitre
1534f24da9
style(picker): cleanup 2025-01-16 13:03:41 +01:00
Folke Lemaitre
772f3e9b89
feat(picker): added smart picker 2025-01-16 13:01:05 +01:00
Folke Lemaitre
de01218d1d
style(picker.git): lua annotations 2025-01-16 09:58:57 +01:00
Anton Kastritskii
cc69043689
feat(picker.git): added git_diff picker for diff hunks (#519)
Hi and thank you for the useful plugin!

## Description

I have been exploring the new picker api and got this git diff picker
working which I think can be a nice addition to the existing set of
picker. The key difference from the existing git_status picker is that
it separates each hunk into its own item similar to `git add --patch`
and when you select an item it takes you to the first hunk's line
instead of top of the buffer. Before I put more effort into it I would
like to see if this is a welcome change first.

This implementation can be further extended by allowing to support
additional arguments such as `--staged`, `--ignore-all-space` or both.

A few points on current implementations. I could not get the per line
parsing to work using the
`require("snacks.picker.source.proc").proc(...)` and fell back to
manually parsing the output after the command finished executing. There
are likely many ways to improve it. I have been using it with telescope
for about a year and so far it worked great. I think more people can
benefit from this picker.

## Related Issue(s)

none

## Screenshots

Demo


https://github.com/user-attachments/assets/6cdfa48e-bc29-4194-8430-092fbc5f3dcd

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2025-01-16 09:54:31 +01:00
Folke Lemaitre
a2fb70e8ba
fix(picker.git): use Snacks.git.get_root instead vim.fs.root for backward compatibility 2025-01-15 21:18:52 +01:00
Kristijan Husak
2cc7cf42e9
fix(picker): set correct cwd for git status picker (#505)
## Description

Cwd was wrong for git status picker.

## Related Issue(s)

- Fixes #504
2025-01-15 20:44:04 +01:00
Folke Lemaitre
96ffaba71b
feat(picker.recent): include open files in recent files. Closes #487 2025-01-15 17:59:01 +01:00
Folke Lemaitre
b15e2585eb
style(picker): more useful transform 2025-01-15 10:59:26 +01:00
Folke Lemaitre
b45d12ce78
style(picker): recent is alias for recent_files 2025-01-15 10:59:04 +01:00
Folke Lemaitre
000db17bf9
feat(picker): added preliminary support for combining finder results. More info coming soon 2025-01-15 10:58:31 +01:00
Folke Lemaitre
ae2de9aa81
fix(grep): explicitely set --no-hidden because of the git filter 2025-01-15 09:53:52 +01:00