[neovim] Restore winfixwidth and winfixheight

Fix https://github.com/junegunn/fzf.vim/issues/128
This commit is contained in:
Junegunn Choi 2016-04-21 00:33:30 +09:00
parent b28c14b93a
commit e867355b2a

View File

@ -307,7 +307,7 @@ function! s:split(dict)
endif endif
execute cmd sz.'new' execute cmd sz.'new'
execute resz sz execute resz sz
return return {}
endif endif
endfor endfor
if s:present(a:dict, 'window') if s:present(a:dict, 'window')
@ -315,20 +315,25 @@ function! s:split(dict)
else else
execute (tabpagenr()-1).'tabnew' execute (tabpagenr()-1).'tabnew'
endif endif
return { '&l:wfw': &l:wfw, '&l:wfh': &l:wfh }
finally finally
setlocal winfixwidth winfixheight buftype=nofile bufhidden=wipe nobuflisted setlocal winfixwidth winfixheight buftype=nofile bufhidden=wipe nobuflisted
endtry endtry
endfunction endfunction
function! s:execute_term(dict, command, temps) abort function! s:execute_term(dict, command, temps) abort
call s:split(a:dict) let winopts = s:split(a:dict)
let fzf = { 'buf': bufnr('%'), 'dict': a:dict, 'temps': a:temps, 'name': 'FZF' } let fzf = { 'buf': bufnr('%'), 'dict': a:dict, 'temps': a:temps, 'name': 'FZF', 'winopts': winopts }
let s:command = a:command let s:command = a:command
function! fzf.on_exit(id, code) function! fzf.on_exit(id, code)
let pos = s:getpos() let pos = s:getpos()
let inplace = pos == s:ppos " {'window': 'enew'} let inplace = pos == s:ppos " {'window': 'enew'}
if !inplace if inplace
for [opt, val] in items(self.winopts)
execute 'let' opt '=' val
endfor
else
if bufnr('') == self.buf if bufnr('') == self.buf
" We use close instead of bd! since Vim does not close the split when " We use close instead of bd! since Vim does not close the split when
" there's no other listed buffer (nvim +'set nobuflisted') " there's no other listed buffer (nvim +'set nobuflisted')