mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 19:33:50 -05:00
fix a bug where the ../ and ./ entries werent being filtered out
This commit is contained in:
@@ -1256,7 +1256,7 @@ function! s:TreeDirNode._initChildren(silent)
|
|||||||
"filter out the .. and . directories
|
"filter out the .. and . directories
|
||||||
"Note: we must match .. AND ../ cos sometimes the globpath returns
|
"Note: we must match .. AND ../ cos sometimes the globpath returns
|
||||||
"../ for path with strange chars (eg $)
|
"../ for path with strange chars (eg $)
|
||||||
if i !~ '^\.\.\/\?$' && i !~ '^\.\/\?$'
|
if i !~ '\/\.\.\/\?$' && i !~ '\/\.\/\?$'
|
||||||
|
|
||||||
"put the next file in a new node and attach it
|
"put the next file in a new node and attach it
|
||||||
try
|
try
|
||||||
@@ -1373,7 +1373,10 @@ function! s:TreeDirNode.refresh()
|
|||||||
let filesStr = globpath(dir.strForGlob(), '*') . "\n" . globpath(dir.strForGlob(), '.*')
|
let filesStr = globpath(dir.strForGlob(), '*') . "\n" . globpath(dir.strForGlob(), '.*')
|
||||||
let files = split(filesStr, "\n")
|
let files = split(filesStr, "\n")
|
||||||
for i in files
|
for i in files
|
||||||
if i !~ '\.\.$' && i !~ '\.$'
|
"filter out the .. and . directories
|
||||||
|
"Note: we must match .. AND ../ cos sometimes the globpath returns
|
||||||
|
"../ for path with strange chars (eg $)
|
||||||
|
if i !~ '\/\.\.\/\?$' && i !~ '\/\.\/\?$'
|
||||||
|
|
||||||
try
|
try
|
||||||
"create a new path and see if it exists in this nodes children
|
"create a new path and see if it exists in this nodes children
|
||||||
|
|||||||
Reference in New Issue
Block a user