Skip to content
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 another-file fails after :SudoWrite #43

Closed
blueyed opened this issue Feb 25, 2016 · 5 comments
Closed

:write another-file fails after :SudoWrite #43

blueyed opened this issue Feb 25, 2016 · 5 comments

Comments

@blueyed
Copy link
Contributor

blueyed commented Feb 25, 2016

TEST CASE:
1. vim /etc/hosts
2. :SudoWrite /tmp/f1
3. :w /tmp/f2

"/tmp/f1" 15L, 298C written
Error occured, when writing undofile

It should write /tmp/f2 instead.

The error related to "undofile" might not be required (I was not seeing it initially).

Ref: 306d3f9

@chrisbra
Copy link
Owner

Hm, I am not sure, it is such a good idea to use :w instead of :SudoWrite. Perhaps I should roll back that. (initially, for such cases the sudo:// protocoll handler was supposed to be used).

@blueyed
Copy link
Contributor Author

blueyed commented Mar 4, 2016

Perhaps I should roll back that

Yeah.
It seems to also cause issues with syntax highlighting not being applied anymore after :w (but not always?!). :syntax on (or :e) is required then (see #36 (comment)).

@blueyed
Copy link
Contributor Author

blueyed commented Mar 31, 2016

@chrisbra
I've just run into this issue again, which I consider rather serious.
I've not checked if the target file name would be available in v:cmdarg also, but it also would mean that SudoEdit has to handle the optional encoding args that can be in there.

Do you still think it should be rolled back?
Is there another approach to handle #36?

@chrisbra
Copy link
Owner

chrisbra commented Apr 2, 2016

If you are going to write root files to a different place, you don't need SudoWrite for that. Or is that place also write protected?

@blueyed
Copy link
Contributor Author

blueyed commented Apr 2, 2016

If you are going to write root files to a different place, you don't need SudoWrite for that. Or is that place also write protected?

Usually it is not, but SudoWrite kicks in because of the BufWriteCmd.

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants