fix filetype detection in sudo>=1.8.13 #SudoEditInit#79
fix filetype detection in sudo>=1.8.13 #SudoEditInit#79ysxninja wants to merge 1 commit intotpope:masterfrom
Conversation
|
Would you happen to have a link to a changelog/CVE/whatever that explains what changed? |
|
Link to bugfix Link to issue |
58eb009 to
e350b22
Compare
| let files = split($SUDO_COMMAND, ' ')[1:-1] | ||
| if len(files) ==# argc() | ||
| for i in range(argc()) | ||
| let ppid = system('ps -o ppid:1= -p ' . getpid()) |
There was a problem hiding this comment.
This appears not to work on BSD ps. Tested on macOS.
| endfunction | ||
| if $SUDO_COMMAND =~# '^sudoedit ' | ||
| let file_name = expand('%:t:p') | ||
| if file_name =~# '.\{-}\(XX\)\@=' |
There was a problem hiding this comment.
This isn't portable either. XX appears to be Linux specific.
|
This feature no longer works on any host I have access to, so I have removed it for now. In addition to the portability issues I have called out, I have concerns about calling I think it may be time to walk away. I am thus closing this PR, but I am not ruling out pursuing a more robust solution. |
|
Well, at least the shell alias worked very well for me and didn't hurt in the pile of all the other aliases and functions. Removing the feature entirely is a bit sad but might as well copy the one function into my vimrc and drop the rest of the plugin. |
|
If that was your attempt to get me to bring it back, then I regret to inform you it has backfired. |
Fix filetype detection in vim-eunuch.
Existing workaround requires creation of a shell function:
sudoedit() { SUDO_COMMAND="sudoedit $1" command sudoedit "$1" }