Skip to content

Commit

Permalink
K: fix [count]K for old Vim
Browse files Browse the repository at this point in the history
The list form of system([...]) only works in Nvim.

fix #194
  • Loading branch information
justinmk committed Sep 7, 2020
1 parent 071e911 commit 9c0dc32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/dirvish.vim
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function! s:info(paths, dirsize) abort
" Slash decides how getftype() classifies directory symlinks. #138
let noslash = substitute(f, escape(s:sep,'\').'$', '', 'g')
let fname = len(a:paths) < 2 ? '' : printf('%12.12s ',fnamemodify(substitute(f,'[\\/]\+$','',''),':t'))
let size = (-1 != getfsize(f) && a:dirsize ? matchstr(system(['du','-hs',f]),'\S\+') : printf('%.2f',getfsize(f)/1000.0).'K')
let size = (-1 != getfsize(f) && a:dirsize ? matchstr(system('du -hs '.shellescape(f)),'\S\+') : printf('%.2f',getfsize(f)/1000.0).'K')
echo (-1 == getfsize(f) ? '?' : (fname.(getftype(noslash)[0]).' '.getfperm(f)
\.' '.strftime('%Y-%m-%d.%H:%M:%S',getftime(f)).' '.size).('link'!=#getftype(noslash)?'':' -> '.fnamemodify(resolve(f),':~:.')))
endfor
Expand Down

0 comments on commit 9c0dc32

Please sign in to comment.