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>
This commit is contained in:
Anthony Qiu 2025-10-21 10:38:24 -04:00 committed by GitHub
parent a5d45d543e
commit 2cf864aaa1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 4 deletions

View file

@ -212,6 +212,9 @@ function M.git_log(item, picker)
msg = body
end
ret[#ret + 1] = { msg, msg_hl }
if item.author then
ret[#ret + 1] = { " <" .. item.author .. ">", "SnacksPickerGitAuthor" }
end
Snacks.picker.highlight.markdown(ret)
Snacks.picker.highlight.highlight(ret, {
["#%d+"] = "SnacksPickerGitIssue",