Reintroduce necessary variable mistakenly removed. (#1040)

* Reintroduce lost variable: splitMode.

* Add a space between splitMode and "split". `verticalsplit` is invalid.

* Update version number, and add attributions (PR authors)
This commit is contained in:
Phil Runninger
2019-09-26 08:47:36 -04:00
committed by GitHub
parent bd744eab8d
commit 5af6859846
2 changed files with 12 additions and 10 deletions

View File

@@ -158,12 +158,13 @@ function! s:Opener._newSplit()
if onlyOneWin
let &splitright = (g:NERDTreeWinPos ==# "left")
endif
" If only one window (ie. NERDTree), split vertically instead.
let splitMode = onlyOneWin ? "vertical" : ""
" Open the new window
try
call nerdtree#exec('wincmd p', 1)
" If only one window (ie. NERDTree), split vertically instead.
call nerdtree#exec(onlyOneWin ? "vertical split" : "split",1)
call nerdtree#exec(splitMode . " split",1)
catch /^Vim\%((\a\+)\)\=:E37/
call g:NERDTree.CursorToTreeWin()
throw "NERDTree.FileAlreadyOpenAndModifiedError: ". self._path.str() ." is already open and modified."