From 41e1b15f4ea8d5e49e954e8c823bed642ba3de71 Mon Sep 17 00:00:00 2001 From: Sander van Harmelen Date: Tue, 15 Nov 2016 20:27:10 +0100 Subject: [PATCH] Change the command to record the NERDTree root path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By using this command a long standing annoyance is finaly solved… With this very small change/fix NERDTree now always opens with the correct path. Before this patch just 10% of my sessions opened with the correct root path for NERDTree. --- autoload/xolox/session.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/xolox/session.vim b/autoload/xolox/session.vim index 1f58004..75705c2 100644 --- a/autoload/xolox/session.vim +++ b/autoload/xolox/session.vim @@ -302,10 +302,10 @@ function! s:check_special_window(session) " pathname, this variable should be set to false to disable normalization. let do_normalize_path = 1 let bufname = expand('%:t') - if exists('b:NERDTreeRoot') + if exists('b:NERDTree.root') if !has_key(s:nerdtrees, bufnr('%')) let command = 'NERDTree' - let argument = b:NERDTreeRoot.path.str() + let argument = b:NERDTree.root.path.str() let s:nerdtrees[bufnr('%')] = 1 else let command = 'NERDTreeMirror' @@ -361,8 +361,8 @@ endfunction function! s:nerdtree_persist() " Remember current working directory and whether NERDTree is loaded. - if exists('b:NERDTreeRoot') - return 'NERDTree ' . fnameescape(b:NERDTreeRoot.path.str()) . ' | only' + if exists('b:NERDTree.root') + return 'NERDTree ' . fnameescape(b:NERDTree.root.path.str()) . ' | only' else return 'cd ' . fnameescape(getcwd()) endif