From a7d585f7af8c81651a274cae9f9e09639483c785 Mon Sep 17 00:00:00 2001 From: Phil Runninger Date: Mon, 4 May 2020 07:59:25 -0400 Subject: [PATCH 1/2] Force NERDTreeFocus to allow events to be fired when switching windows. --- lib/nerdtree/nerdtree.vim | 4 ++-- plugin/NERD_tree.vim | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/nerdtree/nerdtree.vim b/lib/nerdtree/nerdtree.vim index a48f6a86..982db16c 100644 --- a/lib/nerdtree/nerdtree.vim +++ b/lib/nerdtree/nerdtree.vim @@ -96,9 +96,9 @@ endfunction "FUNCTION: s:NERDTree.CursorToTreeWin(){{{1 "Places the cursor in the nerd tree window -function! s:NERDTree.CursorToTreeWin() +function! s:NERDTree.CursorToTreeWin(...) call g:NERDTree.MustBeOpen() - call nerdtree#exec(g:NERDTree.GetWinNum() . 'wincmd w', 1) + call nerdtree#exec(g:NERDTree.GetWinNum() . 'wincmd w', a:0 >0 ? a:1 : 1) endfunction " Function: s:NERDTree.ExistsForBuffer() {{{1 diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index 639f87bb..ca8070d1 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -217,7 +217,7 @@ endfunction function! NERDTreeFocus() if g:NERDTree.IsOpen() - call g:NERDTree.CursorToTreeWin() + call g:NERDTree.CursorToTreeWin(0) else call g:NERDTreeCreator.ToggleTabTree('') endif From 3005a0e9c0fa6a7757d65ba2a5187d0f675dd225 Mon Sep 17 00:00:00 2001 From: Phil Runninger Date: Mon, 4 May 2020 08:11:49 -0400 Subject: [PATCH 2/2] Update version number in change log. --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67f64357..2e1d4305 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,9 @@ - **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR) --> #### 6.7 -- **.8**: Fix example code for the NERDTreeAddKeyMap function. (PhilRunninger) [#1116](https://github.com/preservim/nerdtree/pull/1116) -- **.7**: Put '%' argument in bufname() for backwards compatibility. (PhilRunninger) [#1105](https://github.com/preservim/nerdtree/pull/1105) +- **.9**: Force `:NERDTreeFocus` to allow events to be fired when switching windows. (PhilRunninger) [#1118](https://github.com/preservim/nerdtree/pull/1118) +- **.8**: Fix example code for the `NERDTreeAddKeyMap()` function. (PhilRunninger) [#1116](https://github.com/preservim/nerdtree/pull/1116) +- **.7**: Put `'%'` argument in `bufname()` for backwards compatibility. (PhilRunninger) [#1105](https://github.com/preservim/nerdtree/pull/1105) - **.6**: If a file's already open in the window, don't edit it again. (PhilRunninger) [#1103](https://github.com/preservim/nerdtree/pull/1103) - **.5**: Prevent unneeded tree creation in `:NERDTreeToggle[VCS] ` (PhilRunninger) [#1101](https://github.com/preservim/nerdtree/pull/1101) - **.4**: Add missing calls to the `shellescape()` function (lifecrisis) [#1099](https://github.com/preservim/nerdtree/pull/1099)