fix a bug that was occurring with :set nohidden
previously the code didnt take &hidden (it assumed it was set) into account when determining if splitting was needed when using the o mapping on a file node
This commit is contained in:
parent
9b12953343
commit
f65bc62fac
@ -796,12 +796,12 @@ function! s:TreeFileNode.open()
|
|||||||
call s:exec(winnr . "wincmd w")
|
call s:exec(winnr . "wincmd w")
|
||||||
|
|
||||||
else
|
else
|
||||||
if !s:isWindowUsable(winnr("#")) && s:firstNormalWindow() ==# -1
|
if !s:isWindowUsable(winnr("#")) && s:firstUsableWindow() ==# -1
|
||||||
call self.openSplit()
|
call self.openSplit()
|
||||||
else
|
else
|
||||||
try
|
try
|
||||||
if !s:isWindowUsable(winnr("#"))
|
if !s:isWindowUsable(winnr("#"))
|
||||||
call s:exec(s:firstNormalWindow() . "wincmd w")
|
call s:exec(s:firstUsableWindow() . "wincmd w")
|
||||||
else
|
else
|
||||||
call s:exec('wincmd p')
|
call s:exec('wincmd p')
|
||||||
endif
|
endif
|
||||||
@ -2517,14 +2517,15 @@ function! s:echoError(msg)
|
|||||||
call s:echo(a:msg)
|
call s:echo(a:msg)
|
||||||
echohl normal
|
echohl normal
|
||||||
endfunction
|
endfunction
|
||||||
"FUNCTION: s:firstNormalWindow(){{{2
|
"FUNCTION: s:firstUsableWindow(){{{2
|
||||||
"find the window number of the first normal window
|
"find the window number of the first normal window
|
||||||
function! s:firstNormalWindow()
|
function! s:firstUsableWindow()
|
||||||
let i = 1
|
let i = 1
|
||||||
while i <= winnr("$")
|
while i <= winnr("$")
|
||||||
let bnum = winbufnr(i)
|
let bnum = winbufnr(i)
|
||||||
if bnum != -1 && getbufvar(bnum, '&buftype') ==# ''
|
if bnum != -1 && getbufvar(bnum, '&buftype') ==# ''
|
||||||
\ && !getwinvar(i, '&previewwindow')
|
\ && !getwinvar(i, '&previewwindow')
|
||||||
|
\ && (!getbufvar(bnum, '&modified') || &hidden)
|
||||||
return i
|
return i
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user