lambdalisue / vim-suda

🥪 An alternative sudo.vim for Vim and Neovim, limited support sudo in Windows
MIT License
725 stars 29 forks source link

Problem with -p flag #49

Open cab-1729 opened 2 years ago

cab-1729 commented 2 years ago

There is a problem with the -p flag (which is supposed to open multiple files in different tabs).

If I use nvim -p file1 file2 then everything works as expected if the files do not require superuser permission sto write to. But is file1 requires superuser permissions the file2 is never opened in a separate tab. If any file is passed as a command line argument that needs superuser permissions, the files passed after that argument are not opened in separate tabs.

MuhammedZakir commented 2 years ago

It's not a problem with -p flag. It happens when you (the current user) don't have read permission for that file. When you open such files, you can see a "Permission Denied" message. To open such files, use SudaRead command, or run nvim using sudo.

cab-1729 commented 2 years ago

Using sudo does solve the problem. But the current user does have read permissions for the file. Hence the file opens using nvim without sudo, only that the files passed as an argument after that using the -p flag don't open in different tabs regardless of their permissions. The problem does not appear if this plugin is uninstalled.