diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2016-04-21 00:33:30 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2016-04-21 00:33:30 +0900 |
commit | e867355b2a578438d08b74a1708d6ad582316a48 (patch) | |
tree | c02585aeb4e4d5b1cd955eb310cf65ce6f718afd /plugin | |
parent | b28c14b93a94269f05f904c17547a2e40eebccea (diff) |
[neovim] Restore winfixwidth and winfixheight
Fix https://github.com/junegunn/fzf.vim/issues/128
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/fzf.vim | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 5b0c8d83..a01e582b 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -307,7 +307,7 @@ function! s:split(dict) endif execute cmd sz.'new' execute resz sz - return + return {} endif endfor if s:present(a:dict, 'window') @@ -315,20 +315,25 @@ function! s:split(dict) else execute (tabpagenr()-1).'tabnew' endif + return { '&l:wfw': &l:wfw, '&l:wfh': &l:wfh } finally setlocal winfixwidth winfixheight buftype=nofile bufhidden=wipe nobuflisted endtry endfunction 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 function! fzf.on_exit(id, code) let pos = s:getpos() 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 " We use close instead of bd! since Vim does not close the split when " there's no other listed buffer (nvim +'set nobuflisted') |