commit 5af6859846cc37f1056f2400a932e703e5e4aac5
parent bd744eab8df5730db167a26486bc9afde46c4046
Author: Phil Runninger <PhilRunninger@users.noreply.github.com>
Date: Thu, 26 Sep 2019 08:47:36 -0400
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)
Diffstat:
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
@@ -1,17 +1,18 @@
# Change Log
#### 6.0...
-- **.0**: Make the behavior of window splits consistent [#1035](https://github.com/scrooloose/nerdtree/pull/1035)
+- **.1**: Reintroduce necessary variable mistakenly removed. (PhilRunninger) [#1040](https://github.com/scrooloose/nerdtree/pull/1040)
+- **.0**: Make the behavior of window splits consistent (PhilRunninger) [#1035](https://github.com/scrooloose/nerdtree/pull/1035)
#### 5.3...
-- **.3**: Fix (p)ath not displaying in the minimal menu [#1038](https://github.com/scrooloose/nerdtree/pull/1038)
-- **.2**: Enable events when closing NerdTree window. [#1037](https://github.com/scrooloose/nerdtree/pull/1037)
-- **.1**: Fix the `e` key mapping to use netrw if desired [#1031](https://github.com/scrooloose/nerdtree/pull/1031)
-- **.0**: Add file extension and size to sorting capabilities [#1029](https://github.com/scrooloose/nerdtree/pull/1029)
+- **.3**: Fix (p)ath not displaying in the minimal menu (tuzz) [#1038](https://github.com/scrooloose/nerdtree/pull/1038)
+- **.2**: Enable events when closing NerdTree window. (PhilRunninger) [#1037](https://github.com/scrooloose/nerdtree/pull/1037)
+- **.1**: Fix the `e` key mapping to use netrw if desired (PhilRunninger) [#1031](https://github.com/scrooloose/nerdtree/pull/1031)
+- **.0**: Add file extension and size to sorting capabilities (PhilRunninger) [#1029](https://github.com/scrooloose/nerdtree/pull/1029)
#### 5.2...
-- **.9**: Suppress events for intermediate window/tab/buffer changes [#1026](https://github.com/scrooloose/nerdtree/pull/1026)
+- **.9**: Suppress events for intermediate window/tab/buffer changes (PhilRunninger) [#1026](https://github.com/scrooloose/nerdtree/pull/1026)
- **.8**: Revert [#1019](https://github.com/scrooloose/nerdtree/pull/1019) to fix nvim artifacts and flickering. (PhilRunninger) [#1021](https://github.com/scrooloose/nerdtree/pull/1021)
-- **.7**: Use :mode only in neovim. MacVim still needs to use :redraw! [#1019](https://github.com/scrooloose/nerdtree/pull/1019)
-- **.6**: In CHANGELOG.md and PR template, make reference to PR a true HTML link. [#1017](https://github.com/scrooloose/nerdtree/pull/1017)
+- **.7**: Use :mode only in neovim. MacVim still needs to use :redraw! (PhilRunninger) [#1019](https://github.com/scrooloose/nerdtree/pull/1019)
+- **.6**: In CHANGELOG.md and PR template, make reference to PR a true HTML link. (PhilRunninger) [#1017](https://github.com/scrooloose/nerdtree/pull/1017)
- **.5**: Use `:mode` instead of `:redraw!` when updating menu. (PhilRunninger) [#1016](https://github.com/scrooloose/nerdtree/pull/1016)
- **.4**: When searching for root line num, stop at end of file. (PhilRunninger) [#1015](https://github.com/scrooloose/nerdtree/pull/1015)
- **.3**: Fix `<CR>` key map on the bookmark (lkebin) [#1014](https://github.com/scrooloose/nerdtree/pull/1014)
diff --git a/lib/nerdtree/opener.vim b/lib/nerdtree/opener.vim
@@ -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."