* fix: unnecessary shell commands when autosave off
Problem: Shell programs aren't able to detect nvim exit.
Solution: Avoid running shell-commands unnecessarily on exit.
Programs that spawn nvim in-order to edit a file are unable to detect
nvim exit cleanly because of a race-condition that happens in
`VimLeavePre` and `get_current()` which runs shell commands during exit
even when `autosave` is off.
For example, using nvim nightly, run persisted.nvim with:
```lua
opts.should_autosave = function()
-- Do not autosave if git commit/rebase session.
return vim.env.GIT_EXEC_PATH == nil
end
```
And run `EDITOR=nvim git commit` from shell; git will fail waiting for
nvim to exit cleanly.
* fix: global variable in lowercase initial
When nvim is used as a man pager with `export MANPAGER='nvim +Man! '`, with autoload set to true, persisted.nvim still autoloads the current directory which is not desirable
Telescope extension folder structure is described here:
https://github.com/nvim-telescope/telescope.nvim/wiki/Extensions#extension-folder-structure
When `telescope.load_extension(<name>)` is done, the name is loaded from
path `telescope._extensions.<name>`. With the current structure, one
could do `telescope.load_extension('finders')` and then it will be
available to load through `Telescope finders` which will error
> Error executing Lua callback: ...share/nvim/lazy/telescope.nvim/lua/telescope/command.lua:193: attempt to call a nil value
> stack traceback:
> ...share/nvim/lazy/telescope.nvim/lua/telescope/command.lua:193: in function 'run_command'
> ...share/nvim/lazy/telescope.nvim/lua/telescope/command.lua:253: in function 'load_command'
> ...ocal/share/nvim/lazy/telescope.nvim/plugin/telescope.lua:108: in function <...ocal/share/nvim/lazy/telescope.nvim/plugin/telescope.lua:107>