-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
SudaWrite failure based on cwd? #48
Comments
Not sure but it seems https://github.com/lambdalisue/suda.vim/blob/master/autoload/suda.vim#L74 fails somehow... What happen if you directly call :call suda#write('suda:///etc/foobar') And :echo substitute('suda:///etc/foobar', '\v^(suda://)+', '', '') |
No errors, working as expected
/etc/foobar |
Debugging: plugin/suda.vim
autoload/suda.vim
|
It's quite strange. What happen if you modify the code like function! suda#write(expr, ...) abort range
echomsg "expr:" . a:expr
echomsg "expand:" . expand(a:expr)
echomsg "path:" . s:strip_prefix(expand(a:expr))
" Original code starts from here
let path = s:strip_prefix(expand(a:expr))
" ... |
What about function! suda#write(expr, ...) abort range
echomsg "expr:" . a:expr
echomsg "expand:" . expand(a:expr)
echomsg "bufname:" . bufname("%")
echomsg "expand:" . expand("%")
echomsg "path:" . s:strip_prefix(expand(a:expr))
" Original code starts from here
let path = s:strip_prefix(expand(a:expr))
" ... |
It's quite puzzling... I'm sorry but I've no idea... |
Thought this was an issue with my Linux permissions after removing some shada files, but it seems that I can also reproduce this on my Mac. Just wondering if you are able to reproduce this as well? |
How to reproduce the issue? |
Then launch |
Then I could not reproduce it |
@axieax I can not reproduce this either. Is your vim config available online? |
Hi, yes it's available in my dotconfig repo: https://www.github.com/axieax/dotconfig |
Have you tried reproducing this since your migration to |
Was struggling to debug this issue for a while, not sure if this is expected behaviour?
SudaWrite /etc/environment from / ->
SudoWrite /etc/environment from /etc -> success
The text was updated successfully, but these errors were encountered: