fix: prevent autoloading when there are extra command line arguments passed to nvim (#76)

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
main
Beartama 2023-06-28 03:07:11 +03:00 committed by GitHub
parent c384aa6706
commit 975cd4cd06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -113,7 +113,7 @@ end
---@return nil
function M.autoload()
-- Ensure that no arguments have been passed to Neovim
if config.options.autoload and vim.fn.argc() == 0 then
if config.options.autoload and vim.fn.argc() == 0 and #vim.v.argv < 3 then
if allow_dir() and not ignore_dir() then
M.load()
end