Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] For g:fuf_reuseWindow = 0, force create a new window on split / vsplit / tab open type #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions autoload/fuf.vim
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ function fuf#openBuffer(bufNr, mode, reuse)
return
endif
execute printf({
\ s:OPEN_TYPE_CURRENT : '%sbuffer' ,
\ s:OPEN_TYPE_SPLIT : '%ssbuffer' ,
\ s:OPEN_TYPE_VSPLIT : 'vertical %ssbuffer',
\ s:OPEN_TYPE_TAB : 'tab %ssbuffer' ,
\ s:OPEN_TYPE_CURRENT : '%sbuffer' ,
\ s:OPEN_TYPE_SPLIT : 'split | %sbuffer' ,
\ s:OPEN_TYPE_VSPLIT : 'vsplit | %sbuffer',
\ s:OPEN_TYPE_TAB : 'tabe | %sbuffer' ,
\ }[a:mode], a:bufNr)
endfunction

Expand Down Expand Up @@ -378,6 +378,7 @@ function fuf#launch(modeName, initialPattern, partialMatching)
endif
call l9#tempvariables#setList(s:TEMP_VARIABLES_GROUP, s:oneTimeVariables)
let s:oneTimeVariables = []
let s:currentWin = winnr()
call s:activateFufBuffer()
augroup FufLocal
autocmd!
Expand Down Expand Up @@ -874,6 +875,12 @@ function s:handlerBase.onInsertLeave()
call s:deactivateFufBuffer()
call fuf#saveDataFile(self.getModeName(), 'stats', self.stats)
execute self.windowRestoringCommand
if exists('s:currentWin')
if type(s:currentWin) == v:t_number
exec s:currentWin . 'wincmd w'
unlet s:currentWin
endif
endif
let fOpen = exists('s:reservedCommand')
if fOpen
call self.onOpen(s:reservedCommand[0], s:reservedCommand[1])
Expand Down