Hi,
    I just downloaded NERDTree (just started with VIM) and was keen to
read:

* The script remembers the cursor position and window position in the
NERD
      tree so you can toggle it off (or just close the tree window)
and then
      reopen it (with NERDTreeToggle) the NERD tree window will appear
exactly
      as you left it

on the script;s page a vim.org. However when 'toggling' my cursor was
definitely not being restored to its previous position. I poured over
NERD_tree.vim for a while (a good while :-)) and eneded up making the
following mods:

--- orig/NERD_tree.vim  2009-01-27 17:55:10.000000000 +0000
+++ new/NERD_tree.vim   2009-05-17 20:49:00.000000000 +0100
@@ -159,7 +159,7 @@
 "============================================================
 augroup NERDTree
     "Save the cursor position whenever we close the nerd tree
-    exec "autocmd BufWinLeave *". s:NERDTreeBufName ." call
<SID>saveScreenState()"
+    exec "autocmd BufWinLeave ". s:NERDTreeBufName ."* call
<SID>saveScreenState()"
     "cache bookmarks when vim loads
     autocmd VimEnter * call s:Bookmark.CacheBookmarks(0)
 augroup END
@@ -2999,10 +2999,10 @@
     if s:treeExistsForTab()
         if !s:isTreeOpen()
             call s:createTreeWin()
-            call s:restoreScreenState()
             if !&hidden
                 call s:renderView()
             endif
+            call s:restoreScreenState()
         else
             call s:closeTree()
         endif

As I say, I'm just starting with VIM and so I can't vouch for the
correctness of the above, only that it 'works for me'. Perhaps the
author could comment?


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to