Skip to content

Commit cceba47

Browse files
committed
Remove nonfunctional sudoedit filetype detection
With the removal of SUDO_COMMAND from the sudoedit environment, we're dead in the water. References: tpope#31
1 parent 6c8387a commit cceba47

File tree

3 files changed

+0
-19
lines changed

3 files changed

+0
-19
lines changed

README.markdown

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ include:
1717
[guard][].
1818
* `:SudoWrite`: Write a privileged file with `sudo`.
1919
* `:SudoEdit`: Edit a privileged file with `sudo`.
20-
* File type detection for `sudo -e` is based on original file name.
2120
* Typing a shebang line causes the file type to be re-detected. Additionally
2221
the file will be automically made executable (`chmod +x`) after the next
2322
write.

doc/eunuch.txt

-3
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ COMMANDS *eunuch-commands*
8585

8686
PASSIVE BEHAVIORS *eunuch-passive*
8787

88-
File type detection for files edited with `sudoedit` and `sudo -e` happens
89-
based on the original file name, as found in $SUDO_COMMAND.
90-
9188
If you type a line at the beginning of a file that starts with #! and press
9289
<CR>, The current file type will be re-detected. This is implemented using a
9390
<CR> map. If you already have a <CR> map, you can incorporate this behavior

plugin/eunuch.vim

-15
Original file line numberDiff line numberDiff line change
@@ -279,21 +279,6 @@ command! -bar SudoWrite
279279
\ write!
280280
endif
281281

282-
function! s:SudoEditInit() abort
283-
let files = split($SUDO_COMMAND, ' ')[1:-1]
284-
if len(files) ==# argc()
285-
for i in range(argc())
286-
execute 'autocmd BufEnter' fnameescape(argv(i))
287-
\ 'if empty(&filetype) || &filetype ==# "conf"'
288-
\ '|doautocmd filetypedetect BufReadPost' fnameescape(files[i])
289-
\ '|endif'
290-
endfor
291-
endif
292-
endfunction
293-
if $SUDO_COMMAND =~# '^sudoedit '
294-
call s:SudoEditInit()
295-
endif
296-
297282
command! -bar -nargs=? Wall
298283
\ if empty(<q-args>) |
299284
\ call s:Wall() |

0 commit comments

Comments
 (0)