Commit graph

227 commits

Author SHA1 Message Date
Folke Lemaitre
1417701af6
perf(grep): move match parsing to resolve and fix an issue with .* results. Closes #2308 2025-10-21 22:32:44 +02:00
Folke Lemaitre
c9fa6f7b07
feat(picker): added live support to git_log, which uses -S (pickaxe) to search. Closes #1544 2025-10-21 17:49:13 +02:00
Folke Lemaitre
5782b5cda0
feat(git): allow configuring extra git args and git cmd args for all git sources. See #2178 2025-10-21 17:17:14 +02:00
Anthony Qiu
2cf864aaa1
feat(picker): add author field to git log (#2295)
## Description

Currently in the picker you cant filter git log pickers by author, the
only option to do that right now is to pass it into the opts when you
call it like lua Snacks.picker.git_log({ author="test" }) but most of
the time I would like to filter interactively and also use the field
filtering offered by snacks like file:lua$ and with this new change,
author:test.

## Related Issue(s)

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

## Screenshots
<img width="760" height="842" alt="Screenshot 2025-10-13 at 11 03 28 PM"
src="https://github.com/user-attachments/assets/e57278aa-0fcd-4513-981d-fe8cfe078c64"
/>
<!-- Add screenshots of the changes if applicable. -->

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2025-10-21 16:38:24 +02:00
Folke Lemaitre
a5d45d543e
fix(explorer): reset main when entering another window. Closes #1587 2025-10-21 16:30:33 +02:00
Folke Lemaitre
3b54c8d3d1
feat(picker): add exact match position highlighting for grep results
Uses ripgrep's --replace feature to mark exact match positions with
separators (__snacks__${0}__snacks__), then parses these positions
for precise highlighting.

Benefits:
- Exact match highlighting in list, preview, and file formatter
- Works with any grep pattern (regex, fixed-string, case-insensitive)
- No need for pattern parsing or vim.regex workarounds
- Positions are provided directly by ripgrep, guaranteed accurate

Implementation:
- Added item.positions field to track match character indices
- New highlight.matches() helper for creating match extmarks
- Modified grep source to parse and extract positions from rg output
- Updated list, preview, and format to use positions when available

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 12:27:45 +02:00
hungpt-a8e
2aee35d059
feat(picker.git): allow passing extra args to git log command for file renames (#1964)
Some checks are pending
CI / ci (push) Waiting to run
## Description

Allows passing extra Git arguments (like `--git-dir` or `--work-tree`)
to the rename detection logic inside `M.log` in `picker/source/git.lua`.

Previously, these extra arguments from `opts.args` were applied to the
main `git log` command but ignored during rename detection. This caused
errors or incorrect results when working in non-standard repo setups.

This change uses `git_args(...)` to build the rename detection command,
ensuring consistent argument handling throughout `M.log`.
2025-10-21 09:20:27 +02:00
Iordanis Petkakis
7502e77803
fix(picker.git): add ignorecase for git_grep (#1629)
## Description
Add option for `ignorecase` for `git_grep`
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

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

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
2025-10-21 08:38:26 +02:00
Mohamed Boussaffa
6af1e76758
fix(picker.qflist): error with qflist picker when the list contains invalid items (#2293)
## Description

There is an issue with the quick fix list picker
This happens when list contains some incomplete or invalid items.
The fallback mechanism in the picker have 2 typos that trigger an error
trap

* The item line number field is item.lnum and not item.line
* A check is done on item.text twice in the same if condition, it should
to item.text and item.lnum

## 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-10-20 20:09:08 +02:00
Folke Lemaitre
595963140e
fix(picker.recent): include closed / unlisted buffers in recent. Closes #1745 2025-10-20 18:42:26 +02:00
Aaron Weisberg
a012f394c9
fix(picker.git_diff): use absolute path when adding buffer to avoid duplicates (#1819)
## Description

Uses absolute path for setting the cursor
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)

Fixes #1818 
<!--
  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: Aaron Weisberg <aaron.weisberg@quizlet.com>
2025-10-20 16:03:03 +02:00
Folke Lemaitre
259cb01d7d
style: format 2025-10-20 15:58:58 +02:00
Daniel Danner
93f43ca10f
fix(git): set diff.noprefix=false for git diff to ensure correct format (#2174)
## Description

Parsing the output of git diff here depends on its exact format. The
user environment might be set up with diff.noprefix, in which case the
parsing fails, because the `a/` and `b/` prefixes for the paths is
missing. Passing `-c diff.noprefix=false` to the call overrides this.
<!-- 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-10-20 15:54:26 +02:00
Eric Wong
ca0858a30a
fix(picker.marks): fix buffer checking (#2287)
This buffer number index is 1.
2025-10-20 06:37:28 +02:00
Folke Lemaitre
65a5c8b3d0
fix(picker.grep): faulty rg cmd. Closes #2280 2025-10-19 11:30:35 +02:00
Jozsef Lazar
3e9e2e2d71
feat(picker.projects): make max_depth customizable (#2253)
## Description

By making the `max_depth` customizable, I could provide a single entry
dir to the projects picker to discover all my repos 🤞
2025-10-19 11:00:37 +02:00
Folke Lemaitre
1fee799ad6
fix(picker.grep): better line/col parsing. Closes #2126. Fixes #2123 2025-10-19 10:40:08 +02:00
Andreas Schneider
4bb0dae95d
feat(picker): also ignore dot bare git files (#2058)
## Description

If you clone with --bare then you have a `.bare` and not a `.git`
directory.
2025-10-19 10:35:11 +02:00
Iordanis Petkakis
457596be6d
fix(projects): normalize item.text for correct Windows support (#2275)
## Description
`Snacks.picker.projects` would not show correctly projects on Windows.
`item.text` was something like
`C:\Users\my_user\AppData\Local\nvim-data\lazy\LazyVim\.git\`.

By normalizing `item.text` it shows correctly the projects.
<!-- 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-10-17 21:16:24 +02:00
Folke Lemaitre
ba745ba281
fix(picker.lsp_config): cmd can be a function 2025-09-30 18:16:04 +02:00
Folke Lemaitre
636be5c3d1
feat(picker.lsp_config): added more info to lsp picker 2025-09-30 17:38:04 +02:00
Folke Lemaitre
a0d6eba1a2
fix(picker): lsp_config now includes any configfured LSP and excludes deprecated servers 2025-09-16 11:57:17 +02:00
Folke Lemaitre
292d46f773
feat(picker): updated Snacks.picker.lsp_config to work with vim.lsp.config 2025-09-16 09:18:10 +02:00
Folke Lemaitre
07fefd2a99
fix(lsp): fix deprecated warnings related to lsp client 2025-09-15 07:42:46 +02:00
Folke Lemaitre
3d695ab7d0
feat(picker.git): added all option to also list remote branched for git_branches. Closes #1465 2025-03-01 09:48:31 +01:00
Folke Lemaitre
91c3da0b4b
fix(picker.buffers): add a flag when buffer is visible in a window. See #1417 2025-02-25 14:29:37 +01:00
Folke Lemaitre
cf47fa7cee
fix(picker.recent): expand to full path before normalizing. Closes #1406 2025-02-25 13:58:47 +01:00
Folke Lemaitre
1142f46a27
perf(explorer): only update tree when diagnostics actually changed 2025-02-20 09:54:32 +01:00
Folke Lemaitre
63277f96c9
refactor(compat): use svim.islist 2025-02-20 07:00:05 +01:00
Folke Lemaitre
bc902f7032
feat(compat): added svim, a compatibility layer for Neovim. Closes #1321 2025-02-20 06:59:44 +01:00
Folke Lemaitre
92786c5b03
feat(picker.git_diff): use the diff previewer for git_diff so that delta can be used. See #1302 2025-02-19 16:56:40 +01:00
Imron Gamidli
8c1166165b
feat(git_log): add author filter (#1091)
## Description

I was using LazyGit feature to filter git logs by the author,
unfortunately it was missing in snacks picker. Here is my solution to
it. Let me know if you have better suggestion :)

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2025-02-18 21:12:31 +01:00
Pedro Pombeiro
4d46574b24
feat(picker.git): allow passing extra args to other git pickers (#1205)
## Description

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

This PR builds on
7122a03fdf
to provide a way to pass custom `args` to git command invocations.

An alternative (probably cleaner) way of doing this could be to add an
`args` field to `picker.sources.git`:

```yaml
      picker = {
        ---@class snacks.picker.previewers.Config
        previewers = {
          git = {
            args = git_opts(),
          },
        },
        ---@class snacks.picker.sources.Config
        sources = {
          git = {
            args = git_opts(),
          },
        },
```

## Related Issue(s)

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

Fixes #1184

## Screenshots

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

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2025-02-18 21:07:50 +01:00
Folke Lemaitre
d6a38acbf5
feat(picker): new native diff mode (disabled by default). Can be used to show delta diffs for undo. Closes #1288 2025-02-18 20:47:11 +01:00
Folke Lemaitre
b65178b470
feat(image): show progress indicator when converting image files 2025-02-17 23:56:55 +01:00
Folke Lemaitre
c3419cbf8b
refactor(image): use multi spawn 2025-02-17 23:13:12 +01:00
Folke Lemaitre
eced3033ea
feat(debug): graduate proc debug to Snacks.debug.cmd 2025-02-16 22:56:28 +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
f3cdd02620
fix(picker.lsp): handle invalid lsp kinds. Closes #1182 2025-02-14 22:52:56 +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
7d350bc0c7
fix(buffers): use " mark for full buffer position when set. Closes #1160 2025-02-14 07:31:28 +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
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
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