snacks.nvim/lua/snacks
Iordanis Petkakis 340cc2756e
fix(terminal): gf properly opens file (#45)
## Description
1. Currently `gf` only search in current working directory. Use `**` in
`findfile()` to do a recursive search. Otherwise, `gf` can't open a file
down a nested directory.
2. `vim.schedule` the command `vim.cmd("e ", f)`, because otherwise it
opens the file but goes to the buffer that was already opened. Not sure
why this happens, but if we schedule it correctly goes to the opened
buffer by `gf`.
3. Also changed `self:close()` to `self:toggle()`, so as not to reset
the state of the terminal unless a user specifically exits the terminal.
This is rather personal and also based on a [LazyVim
Discussion](https://github.com/LazyVim/LazyVim/discussions/4741), but I
can understand if it's not wanted in the scope of `snacks.nvim` and
probably users could change the behavior of the `gf` key in their
personal configuration.

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

## Related Issue(s)
[A LazyVim
discussion](https://github.com/LazyVim/LazyVim/discussions/4741)
<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
2024-11-09 15:01:39 +01:00
..
bigfile.lua docs: better docgen using treesitter 2024-11-09 14:42:09 +01:00
bufdelete.lua feat(bufdelete): added wipe option. Closes #38 2024-11-09 15:01:10 +01:00
debug.lua docs: better docgen using treesitter 2024-11-09 14:42:09 +01:00
docs.lua docs: better docgen using treesitter 2024-11-09 14:42:09 +01:00
git.lua docs: better docgen using treesitter 2024-11-09 14:42:09 +01:00
gitbrowse.lua docs: better docgen using treesitter 2024-11-09 14:42:09 +01:00
init.lua fix(config): deepcopy config where needed 2024-11-06 22:36:37 +01:00
lazygit.lua docs: better docgen using treesitter 2024-11-09 14:42:09 +01:00
notifier.lua feat(notifier): added backward compatibility for nvim-notify's replace option 2024-11-09 14:44:48 +01:00
notify.lua docs: better docgen using treesitter 2024-11-09 14:42:09 +01:00
quickfile.lua docs: better docgen using treesitter 2024-11-09 14:42:09 +01:00
rename.lua docs: better docgen using treesitter 2024-11-09 14:42:09 +01:00
statuscolumn.lua docs: better docgen using treesitter 2024-11-09 14:42:09 +01:00
terminal.lua fix(terminal): gf properly opens file (#45) 2024-11-09 15:01:39 +01:00
toggle.lua docs: moar docs 2024-11-06 11:43:50 +01:00
win.lua perf(win): prevent treesitter and syntax attaching to scratch buffers 2024-11-08 15:39:17 +01:00
words.lua docs: better docgen using treesitter 2024-11-09 14:42:09 +01:00