## 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>
Snacks picker allows setting an icon for selected list entries.
With this PR, we can also select one for unselected entries.
I think it looks great.

(Replica of #583 which I closed by mistake, sorry about that.)
---------
Co-authored-by: biggybi <biggybi@pm.me>
Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
## Description
More info coming tomorrow.
In short:
- very fast. pretty much realtime filtering/sorting in huge repos (like
1.7 million files)
- extensible
- easy to customize the layout (and lots of presets) with
`snacks.layout`
- simple to create custom pickers
- `vim.ui.select`
- lots of builtin pickers
- uses treesitter highlighting wherever it makes sense
- fast lua fuzzy matcher which supports the [fzf
syntax](https://junegunn.github.io/fzf/search-syntax/) and additionally
supports field filters, like `file:lua$ 'function`
There's no snacks picker command, just use lua.
```lua
-- all pickers
Snacks.picker()
-- run files picker
Snacks.picker.files(opts)
Snacks.picker.pick("files", opts)
Snacks.picker.pick({source = "files", ...})
```
<!-- Describe the big picture of your changes to communicate to the
maintainers
why we should accept this pull request. -->
## Todo
- [x] issue with preview loc not always correct when scrolling fast in
list (probably due to `snacks.scroll`)
- [x] `grep` (`live_grep`) is sometimes too fast in large repos and can
impact ui rendering. Not very noticeable, but something I want to look
at.
- [x] docs
- [x] treesitter highlights are broken. Messed something up somewhere
## 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. -->