diff --git a/lib/nerdtree/ui.vim b/lib/nerdtree/ui.vim index 41ec21d..22e450c 100644 --- a/lib/nerdtree/ui.vim +++ b/lib/nerdtree/ui.vim @@ -325,13 +325,6 @@ endfunction "Saves the current cursor position in the current buffer and the window "scroll position function! s:UI.saveScreenState() - - "FIXME: b:NERDTreeType should really me moved to b:NERDTree.type. Update - "this when that refactor is done - if b:NERDTreeType == "secondary" - return - endif - let win = winnr() call g:NERDTree.CursorToTreeWin() let self._screenState = {} diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index 3eae93b..bd911c6 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -148,7 +148,7 @@ call nerdtree#ui_glue#setupCommands() "============================================================ augroup NERDTree "Save the cursor position whenever we close the nerd tree - exec "autocmd BufLeave ". g:NERDTreeCreator.BufNamePrefix() ."* call b:NERDTree.ui.saveScreenState()" + exec "autocmd BufLeave ". g:NERDTreeCreator.BufNamePrefix() ."* if g:NERDTree.IsOpen() | call b:NERDTree.ui.saveScreenState() | endif" "disallow insert mode in the NERDTree exec "autocmd BufEnter ". g:NERDTreeCreator.BufNamePrefix() ."* stopinsert"