nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit a33849ef9b914b2cdb33ff8a5bf376b17b2a8ac3
parent b09e0fbfa453b322f1a6b42b324d17d2c3450b23
Author: Martin Grenfell <martin_grenfell@msn.com>
Date:   Wed, 24 Dec 2008 00:57:01 +1300

change the way nerd tree buffers are named

Use a sequential numbering system instead of timestamps. This makes the
buffer names shorter and neater and easier on the eye when using
:NERDTreeMirror

Diffstat:
Mplugin/NERD_tree.vim | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim
@@ -130,7 +130,7 @@ call s:initVariable("g:NERDTreeMapUpdirKeepOpen", "U")
 
 "SECTION: Script level variable declaration{{{2
 let s:escape_chars =  " \\`\|\"#%&,?()\*^<>"
-let s:NERDTreeBufName = '_NERD_tree_'
+let s:NERDTreeBufName = 'NERD_tree_'
 
 let s:tree_wid = 2
 let s:tree_markup_reg = '^[ `|]*[\-+~]'
@@ -141,6 +141,9 @@ if s:running_windows
     let s:os_slash = '\'
 endif
 
+"the number to add to the nerd tree buffer name to make the buf name unique
+let s:next_buffer_number = 1
+
 " SECTION: Commands {{{1
 "============================================================
 "init the command that users start the nerd tree with
@@ -1980,7 +1983,8 @@ function! s:createTreeWin()
     let splitLocation = g:NERDTreeWinPos == "left" ? "topleft " : "botright "
     let splitSize = g:NERDTreeWinSize
     if !exists('t:NERDTreeBufName')
-        let t:NERDTreeBufName = localtime() . s:NERDTreeBufName
+        let t:NERDTreeBufName = s:NERDTreeBufName . s:next_buffer_number
+        let s:next_buffer_number += 1
     endif
     let cmd = splitLocation . 'vertical ' . splitSize . ' new ' . t:NERDTreeBufName
     silent! execute cmd