mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05:00
Use a better arg for FINDSTR when using the m,l command in Windows. (#887)
* Use a better arg for FINDSTR when using the m,l command in Windows. * Remove trailing spaces. * Use vim getf...() functions in place of DOS commands. * Remove unnecessary variable. * Put labels in the text of the file/dir listing.
This commit is contained in:
@@ -248,33 +248,13 @@ function! NERDTreeListNodeWin32()
|
|||||||
let l:node = g:NERDTreeFileNode.GetSelected()
|
let l:node = g:NERDTreeFileNode.GetSelected()
|
||||||
|
|
||||||
if !empty(l:node)
|
if !empty(l:node)
|
||||||
|
let l:path = l:node.path.str()
|
||||||
let l:save_shell = &shell
|
call nerdtree#echo(printf("%s:%s MOD:%s BYTES:%d PERMISSIONS:%s",
|
||||||
set shell&
|
\ toupper(getftype(l:path)),
|
||||||
|
\ fnamemodify(l:path, ':t'),
|
||||||
if exists('+shellslash')
|
\ strftime("%c", getftime(l:path)),
|
||||||
let l:save_shellslash = &shellslash
|
\ getfsize(l:path),
|
||||||
set noshellslash
|
\ getfperm(l:path)))
|
||||||
endif
|
|
||||||
|
|
||||||
let l:command = 'DIR /Q '
|
|
||||||
\ . shellescape(l:node.path.str())
|
|
||||||
\ . ' | FINDSTR "^[012][0-9]/[0-3][0-9]/[12][0-9][0-9][0-9]"'
|
|
||||||
|
|
||||||
let l:metadata = split(system(l:command), "\n")
|
|
||||||
|
|
||||||
if v:shell_error == 0
|
|
||||||
call nerdtree#echo(l:metadata[0])
|
|
||||||
else
|
|
||||||
call nerdtree#echoError('shell command failed')
|
|
||||||
endif
|
|
||||||
|
|
||||||
let &shell = l:save_shell
|
|
||||||
|
|
||||||
if exists('l:save_shellslash')
|
|
||||||
let &shellslash = l:save_shellslash
|
|
||||||
endif
|
|
||||||
|
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user