- Fixed for sudo.

This commit is contained in:
Shougo Matsushita
2013-09-26 15:24:48 +09:00
parent 24b2ed20c6
commit 4c67a1b1ac
2 changed files with 16 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
"=============================================================================
" FILE: util.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 02 Mar 2013.
" Last Modified: 26 Sep 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@@ -110,6 +110,13 @@ function! neosnippet#util#parse_options(args, options_list) "{{{
return [args, options]
endfunction"}}}
" Sudo check.
function! neosnippet#util#is_sudo() "{{{
return $SUDO_USER != '' && $USER !=# $SUDO_USER
\ && $HOME !=# expand('~'.$USER)
\ && $HOME ==# expand('~'.$SUDO_USER)
endfunction"}}}
let &cpo = s:save_cpo
unlet s:save_cpo