Making the cross-platform /dev/null reusable
This commit is contained in:
parent
3cade031b6
commit
9c94652917
@ -162,13 +162,8 @@ endfunction
|
||||
|
||||
" Function: #get_diff_perforce {{{1
|
||||
function! sy#repo#get_diff_perforce() abort
|
||||
if has('win32') || has ('win64')
|
||||
let null = 'NUL'
|
||||
else
|
||||
let null = '/dev/null'
|
||||
endif
|
||||
let diffoptions = has_key(g:signify_diffoptions, 'perforce') ? g:signify_diffoptions.perforce : ''
|
||||
let diff = system('p4 monitor show 2>&1 >' . null . ' && env P4DIFF=diff p4 diff -dU0 '. diffoptions .' '. sy#util#escape(b:sy.path))
|
||||
let diff = system('p4 monitor show 2>&1 >' . sy#util#devnull() . ' && env P4DIFF=diff p4 diff -dU0 '. diffoptions .' '. sy#util#escape(b:sy.path))
|
||||
return v:shell_error ? [0, ''] : [1, diff]
|
||||
endfunction
|
||||
|
||||
|
@ -75,3 +75,13 @@ function! sy#util#hunk_text_object(emptylines) abort
|
||||
execute hunks[0].end
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Function: #devnull {{{1
|
||||
function! sy#util#devnull() abort
|
||||
if has('win32') || has ('win64')
|
||||
let null = 'NUL'
|
||||
else
|
||||
let null = '/dev/null'
|
||||
endif
|
||||
return null
|
||||
endfunction
|
||||
|
Loading…
Reference in New Issue
Block a user