From 51e896ff66e4e06e334b4f32b37c2619e8b755f9 Mon Sep 17 00:00:00 2001 From: Carlos Alvarez Date: Sat, 30 Sep 2017 13:44:58 +0200 Subject: [PATCH 1/2] fix nerdtree root path var --- 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 From a97313285f7937728da74b8a62004fa3140f40a5 Mon Sep 17 00:00:00 2001 From: Carlos Alvarez Date: Sat, 30 Sep 2017 14:01:24 +0200 Subject: [PATCH 2/2] add custom commands loading from session file --- autoload/xolox/session.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/autoload/xolox/session.vim b/autoload/xolox/session.vim index 75705c2..2481529 100644 --- a/autoload/xolox/session.vim +++ b/autoload/xolox/session.vim @@ -64,6 +64,10 @@ function! xolox#session#save_session(commands, filename) " {{{2 endif call add(a:commands, 'unlet SessionLoad') call add(a:commands, '" vim: ft=vim ro nowrap smc=128') + call add(a:commands, 'let b:customFile=v:this_session.".custom"') + call add(a:commands, 'if filereadable(b:customFile)') + call add(a:commands, ' execute "source ".b:customFile') + call add(a:commands, 'endif') endfunction function! xolox#session#save_globals(commands) " {{{2