nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit f404cdd54bd5152128617cf4156d124f9949aa99
parent c463234452cf6701ebe4a65d7015434d5c96f6f7
Author: Martin Grenfell <martin_grenfell@msn.com>
Date:   Sun, 13 Jul 2008 13:43:43 +1200

update bookmarks when moving via filesystem menu

Diffstat:
Mplugin/NERD_tree.vim | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim
@@ -286,6 +286,11 @@ function! s:oBookmark.New(name, path) dict
     let newBookmark.path = a:path
     return newBookmark
 endfunction
+" Function: oBookmark.SetPath(path)   {{{3
+" makes this bookmark point to the given path
+function! s:oBookmark.SetPath(path) dict
+    let self.path = a:path
+endfunction
 " Function: oBookmark.Sort()   {{{3
 " Class method that sorts all bookmarks
 function! s:oBookmark.Sort() dict
@@ -1400,6 +1405,12 @@ function! s:oPath.Rename(newPath) dict
         throw "NERDTree.Path.Rename Exception: Could not rename: '" . self.StrForOS(0) . "'" . 'to:' . a:newPath
     endif
     call self.ReadInfoFromDisk(a:newPath)
+
+    for i in self.BookmarkNames()
+        let b = s:oBookmark.BookmarkFor(i)
+        call b.SetPath(copy(self))
+    endfor
+    call s:oBookmark.Write()
 endfunction
 
 "FUNCTION: oPath.Str(esc) {{{3