From ef1a466342951fb5c0a55c5ef651f780d15ae042 Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Sun, 4 May 2008 16:48:32 +1200 Subject: [PATCH] make the script able to handle strange filenames with random chars in them (eg {'$%^&) --- plugin/NERD_tree.vim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index c443d53..46189a8 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -110,7 +110,7 @@ call s:InitVariable("g:NERDTreeMapUpdir", "u") call s:InitVariable("g:NERDTreeMapUpdirKeepOpen", "U") "SECTION: Script level variable declaration{{{2 -let s:escape_chars = " `|\"~'#" +let s:escape_chars = " \\`\|\"#%&,?()\*^<>" let s:NERDTreeWinName = '_NERD_tree_' "init all the nerd tree markup @@ -553,7 +553,7 @@ function! s:oTreeDirNode.InitChildren(silent) dict "get an array of all the files in the nodes dir let dir = self.path - let filesStr = globpath(dir.StrForOS(0), '*') . "\n" . globpath(dir.StrForOS(0), '.*') + let filesStr = globpath(dir.StrForOS(1), '*') . "\n" . globpath(dir.StrForOS(1), '.*') let files = split(filesStr, "\n") if !a:silent && len(files) > g:NERDTreeNotificationThreshold @@ -564,7 +564,7 @@ function! s:oTreeDirNode.InitChildren(silent) dict for i in files "filter out the .. and . directories - if i !~ '\.\.$' && i !~ '\.$' + if i !~ '\.\..\?$' && i !~ '\..\?$' "put the next file in a new node and attach it try @@ -933,7 +933,7 @@ function! s:oPath.Delete() dict "if we are runnnig windows then put quotes around the pathstring let cmd = g:NERDTreeRemoveDirCmd . self.StrForOS(1) else - let cmd = g:NERDTreeRemoveDirCmd . self.StrForOS(0) + let cmd = g:NERDTreeRemoveDirCmd . self.StrForOS(1) endif let success = system(cmd) @@ -1129,7 +1129,7 @@ endfunction "FUNCTION: oPath.Refresh() {{{3 function! s:oPath.Refresh() dict - call self.ReadInfoFromDisk(self.Str(0)) + call self.ReadInfoFromDisk(self.Str(1)) endfunction "FUNCTION: oPath.Rename() {{{3 @@ -1322,7 +1322,7 @@ function! s:InitNerdTree(dir) "if instructed to, then change the vim CWD to the dir the NERDTree is "inited in if g:NERDTreeChDirMode != 0 - exec "cd " . path.StrForOS(1) + exec 'cd ' . path.StrForOS(1) endif let t:treeShowHelp = 0