From 5faae7b8f393e3785c5969232ef5bc79332808c4 Mon Sep 17 00:00:00 2001 From: eph Date: Sun, 9 Jun 2024 00:51:33 +0800 Subject: [PATCH] compatible with incline.nvim --- lib/nerdtree/opener.vim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/nerdtree/opener.vim b/lib/nerdtree/opener.vim index 27993ac7..7d2235cb 100644 --- a/lib/nerdtree/opener.vim +++ b/lib/nerdtree/opener.vim @@ -163,7 +163,7 @@ function! s:Opener._newSplit() " Open the new window try call nerdtree#exec('wincmd p', 1) - call nerdtree#exec(splitMode . ' split',1) + call nerdtree#exec(splitMode . ' split', 0) catch /^Vim\%((\a\+)\)\=:E37/ call g:NERDTree.CursorToTreeWin() throw 'NERDTree.FileAlreadyOpenAndModifiedError: '. self._path.str() .' is already open and modified.' @@ -193,7 +193,7 @@ function! s:Opener._newVSplit() endif call nerdtree#exec('wincmd p', 1) - call nerdtree#exec('vsplit', 1) + call nerdtree#exec('vsplit', 0) let l:currentWindowNumber = winnr() @@ -234,6 +234,7 @@ function! s:Opener._openFile() endif call self._path.edit() + doautocmd WinEnter endfunction " FUNCTION: Opener._openDirectory(node) {{{1 @@ -264,9 +265,9 @@ function! s:Opener._previousWindow() else try if !self._isWindowUsable(winnr('#')) - call nerdtree#exec(self._firstUsableWindow() . 'wincmd w', 1) + call nerdtree#exec(self._firstUsableWindow() . 'wincmd w', 0) else - call nerdtree#exec('wincmd p', 1) + call nerdtree#exec('wincmd p', 0) endif catch /^Vim\%((\a\+)\)\=:E37/ call g:NERDTree.CursorToTreeWin()