mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 11:53:48 -05:00
fix a bug when opening files in a new tab
On bufleave we save the nerdtree window state. However, sometimes when bufleave is triggered the tree is no longer open in this tab - e.g. for secondary trees or mappings that open in another tab. Dont bother saving screen state in these cases as the code doing the saving assumes the tree is available in this tab.
This commit is contained in:
@@ -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 = {}
|
||||
|
||||
Reference in New Issue
Block a user