|
|
@@ -132,6 +132,7 @@ let s:originBuffer = 0
|
|
|
let s:running = 0
|
|
|
let s:sort_by = ["number", "name", "fullpath", "mru", "extension"]
|
|
|
let s:splitMode = ""
|
|
|
+let s:didSplit = 0
|
|
|
let s:types = {"fullname": ':p', "path": ':p:h', "relativename": ':~:.', "relativepath": ':~:.:h', "shortname": ':t'}
|
|
|
|
|
|
" Setup the autocommands that handle the MRUList and other stuff. {{{2
|
|
|
@@ -361,6 +362,7 @@ function! s:Cleanup()
|
|
|
|
|
|
let s:running = 0
|
|
|
let s:splitMode = ""
|
|
|
+ let s:didSplit = 0
|
|
|
|
|
|
delmarks!
|
|
|
endfunction
|
|
|
@@ -453,6 +455,9 @@ function! BufExplorer()
|
|
|
|
|
|
" Restore the original settings.
|
|
|
let [&splitbelow, &splitright] = [_splitbelow, _splitright]
|
|
|
+
|
|
|
+ " Remember that a split was triggered
|
|
|
+ let s:didSplit = 1
|
|
|
endif
|
|
|
|
|
|
if !exists("b:displayMode") || b:displayMode != "winmanager"
|
|
|
@@ -1039,7 +1044,7 @@ function! s:Close()
|
|
|
endif
|
|
|
|
|
|
" If we needed to split the main window, close the split one.
|
|
|
- if s:splitMode != "" && bufwinnr(s:originBuffer) != -1
|
|
|
+ if s:didSplit == 1 && bufwinnr(s:originBuffer) != -1
|
|
|
execute "wincmd c"
|
|
|
endif
|
|
|
|