Skip to content

Commit

Permalink
compatible with incline.nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
eph authored and eph committed Jun 8, 2024
1 parent fbb71fc commit 5faae7b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/nerdtree/opener.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -234,6 +234,7 @@ function! s:Opener._openFile()
endif

call self._path.edit()
doautocmd WinEnter
endfunction

" FUNCTION: Opener._openDirectory(node) {{{1
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 5faae7b

Please sign in to comment.