## Description
Resolves the following error, which occurs when removing a visual line
selection in a TypeScript file when `indent.scope.underline` is `true`:
```
Error Error in decoration provider snacks_indent.win:
Error executing lua: ....local/share/nvim/lazy/snacks.nvim/lua/snacks/indent.lua:317: attempt to get length of local 'scope_from' (a nil value)
stack traceback:
....local/share/nvim/lazy/snacks.nvim/lua/snacks/indent.lua:317: in function 'render_scope'
....local/share/nvim/lazy/snacks.nvim/lua/snacks/indent.lua:285: in function 'on_win'
....local/share/nvim/lazy/snacks.nvim/lua/snacks/indent.lua:496: in function <....local/share/nvim/lazy/snacks.nvim/lua/snacks/indent.lua:494>
[builtin#36]: at 0x7f91509530e0
...ghtly/share/nvim/runtime/lua/vim/lsp/semantic_tokens.lua:307: in function 'handler'
...rapped-nightly/share/nvim/runtime/lua/vim/lsp/client.lua:679: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
Error in decoration provider snacks_indent.win:
Error executing lua: ....local/share/nvim/lazy/snacks.nvim/lua/snacks/indent.lua:317: attempt to get length of local 'scope_from' (a nil value)
stack traceback:
....local/share/nvim/lazy/snacks.nvim/lua/snacks/indent.lua:317: in function 'render_scope'
....local/share/nvim/lazy/snacks.nvim/lua/snacks/indent.lua:285: in function 'on_win'
....local/share/nvim/lazy/snacks.nvim/lua/snacks/indent.lua:496: in function <....local/share/nvim/lazy/snacks.nvim/lua/snacks/indent.lua:494>
[C]: in function 'nvim_command'
....local/share/nvim/lazy/nui.nvim/lua/nui/popup/border.lua:624: in function '_relayout'
...m/.local/share/nvim/lazy/nui.nvim/lua/nui/popup/init.lua:390: in function 'update_layout'
....local/share/nvim/lazy/noice.nvim/lua/noice/view/nui.lua:246: in function <....local/share/nvim/lazy/noice.nvim/lua/noice/view/nui.lua:245>
[C]: in function 'pcall'
....local/share/nvim/lazy/noice.nvim/lua/noice/view/nui.lua:143: in function 'reset'
...local/share/nv
```
## Steps to reproduce
Edit a TypeScript file with the following contents:
```typescript
//
const test = {
};
````
Remove the file contents with `ggVGd` to trigger the error.
## Description
Currently `opts.args` are set to a specific value. Allow users to
optionally pass their own additional args.
<!-- 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. -->
## Description
Currently the user is not able to disable the existing keys in
`keys.textobject`, because if he sets for example `ii = false`, it
throws an error about not being able to index `opts`.
<!-- 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 LazyVim discussion
https://github.com/LazyVim/LazyVim/discussions/6118
<!--
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: Folke Lemaitre <folke.lemaitre@gmail.com>
## Description
I noticed in the project picker that when pressing `<c-r>` to show
recent files it showed recent files from everywhere instead of only the
item's directory. When the source is `recent` we have to pass
`filter.cwd = ...` so that it correctly filters out recent items.
<!-- 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. -->
---------
Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
## 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. -->
## Description
I was trying to create a simple `select` picker to choose terminals to
open.
With the current implementation only the fields `cmd` and `id` are
exposed. `cwd` and `env` are not which are used to get the terminal id
as well.
`M.list()` uses `vim.tbl_filter` which turns `terminals` into a list
removing the keys terminal ids. Even if that was not the case (i.e using
a normal `for` loop to add to `terminals`) the keys would be a string
due to `vim.inspect` and one would have to use patterns to extract
information from them.
It's easier to just add `cwd` and `env` to `vim.b[buf].snacks_terminal`
to have that information available and be easier for users to manipulate
which terminal they want to choose and open.
Also added `opts.count` as an option to be able to programmatically
choose the terminal with exactly the same options when it was created,
so one can just do
```lua
local term = vim.b[buf].snacks_terminal
Snacks.terminal(term.cmd, { cwd = term.cwd, env = term.env, count = term.id })
```
to programmatically invoke a certain terminal.
<!-- Describe the big picture of your changes to communicate to the
maintainers
why we should accept this pull request. -->
## Related Issue(s)
Solves my issue and #2271 as well.
<!--
If this PR fixes any issues, please link to the issue here.
- Fixes #<issue_number>
-->
## Screenshots
<!-- Add screenshots of the changes if applicable. -->
## Description
I noticed that lazygit was erroring out on open when the default config
file was missing even though lazygit outside of neovim opened fine
without it. Tracked it to the `LG_CONFIG_FILE` var that tells lazygit to
error out when any of the files are missing - and snacks was setting
this to include the default config even when it didn't exist.
## Related Issue(s)
fixes issue: https://github.com/folke/snacks.nvim/issues/1548
## Description
In certain filesystems — such as bind mounts, NFS, FUSE, or other
mounted paths — uv.fs_scandir_next() may return a nil type for valid
directories. This causes the snacks.nvim explorer to treat mounted
folders as files, making them unexpandable in the UI.
This patch adds a fallback to resolve the correct type when
fs_scandir_next() returns nil. It uses uv.fs_stat() first, and falls
back to vim.fn.isdirectory() if needed.
This ensures that mounted directories are properly marked as navigable.
Code change summary:
- Inside Tree:expand, we now check t == nil
- If so, we call uv.fs_stat() to get the true type
- If fs_stat fails, we fallback to vim.fn.isdirectory
- Final dir = true logic remains intact
Impact:
- Fixes a long-standing bug in mounted directories under /mnt, FUSE,
etc.
- Only runs extra checks when needed (no performance hit for regular
files)
- No changes elsewhere — clean, isolated patch
## Related Issue(s)
- Fixes#2036
## Screenshots
before:
<img width="1907" height="946" alt="image"
src="https://github.com/user-attachments/assets/15e1b8a5-c999-49e8-8ab5-1d23c60e4969"
/>
after:
<img width="343" height="902" alt="Screenshot_20250715_222920"
src="https://github.com/user-attachments/assets/c7ca2fa0-e0cc-4e3d-a4bb-5345538408f7"
/>
---------
Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>