Skip to content

Commit 9c0dc32

Browse files
committed
K: fix [count]K for old Vim
The list form of system([...]) only works in Nvim. fix justinmk#194
1 parent 071e911 commit 9c0dc32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: autoload/dirvish.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function! s:info(paths, dirsize) abort
7171
" Slash decides how getftype() classifies directory symlinks. #138
7272
let noslash = substitute(f, escape(s:sep,'\').'$', '', 'g')
7373
let fname = len(a:paths) < 2 ? '' : printf('%12.12s ',fnamemodify(substitute(f,'[\\/]\+$','',''),':t'))
74-
let size = (-1 != getfsize(f) && a:dirsize ? matchstr(system(['du','-hs',f]),'\S\+') : printf('%.2f',getfsize(f)/1000.0).'K')
74+
let size = (-1 != getfsize(f) && a:dirsize ? matchstr(system('du -hs '.shellescape(f)),'\S\+') : printf('%.2f',getfsize(f)/1000.0).'K')
7575
echo (-1 == getfsize(f) ? '?' : (fname.(getftype(noslash)[0]).' '.getfperm(f)
7676
\.' '.strftime('%Y-%m-%d.%H:%M:%S',getftime(f)).' '.size).('link'!=#getftype(noslash)?'':' -> '.fnamemodify(resolve(f),':~:.')))
7777
endfor

0 commit comments

Comments
 (0)