New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write with sudo not taking place with sudo:* #10
Comments
|
How do you write the file? What are the permissions of the file? I can't reproduce the issue currently. |
I am writing the file with regular :w Shouldn't this autocmd --
-- being working ? However, when I do :doautocmd Sudo FileWriteCmd it says 'no matching autocommands' Interestingly, SudoRead autocmd seems to be working fine (tested on a 0600 file) Also, manually calling SudoWrite works but autocmd is the issue. It looks like vim doesn't apply sudo:* match for the write autocmd |
Hi Raghavendra! On Fr, 06 Jan 2012, Raghavendra D Prabhu wrote:
Is there a reason, you need to do the :doautocmd instead of simply using regards, |
Hi,
I will investigate more and let you know. Also, I tested this
|
ok, this happens, because the plugin removes the sudo:// protocoll handler when reading files. Therefore the pattern from the autocommand does not match anymore and writing won't happen. However, the last commit I pushed, should make it possible. |
Hi,
Thanks for looking into it and fixing it. I will pull, test it and let you know.Raghavendra Prabhu |
I pulled and used it, however it was still failing for me in something like -- vim sudo:/etc/wgetrc (full path) Then I noticed that code is looking for sudo:// whereas the autocmd is looking for sudo:/* and sudo:* So I modified the code to following and it works fine for me now:
|
Thanks, I commit your patch |
closing |
http://sprunge.us/IIDa is the output of :verbose autocmd BufWriteCmd
http://sprunge.us/jccZ is the output of :verbose autocmd FileWriteCmd
For instance for
vim sudo:/etc/rc.conf
while writing I get
The text was updated successfully, but these errors were encountered: