diff --git a/lib/nerdtree/ui.vim b/lib/nerdtree/ui.vim index 417e6ae..41ec21d 100644 --- a/lib/nerdtree/ui.vim +++ b/lib/nerdtree/ui.vim @@ -325,16 +325,20 @@ 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() - try - call g:NERDTree.CursorToTreeWin() - let self._screenState = {} - let self._screenState['oldPos'] = getpos(".") - let self._screenState['oldTopLine'] = line("w0") - let self._screenState['oldWindowSize']= winwidth("") - call nerdtree#exec(win . "wincmd w") - catch /^NERDTree.InvalidOperationError/ - endtry + call g:NERDTree.CursorToTreeWin() + let self._screenState = {} + let self._screenState['oldPos'] = getpos(".") + let self._screenState['oldTopLine'] = line("w0") + let self._screenState['oldWindowSize']= winwidth("") + call nerdtree#exec(win . "wincmd w") endfunction "FUNCTION: s:UI._stripMarkup(line, removeLeadingSpaces){{{1