Skip to content
Snippets Groups Projects
Unverified Commit f0256028 authored by Joshua Rubin's avatar Joshua Rubin Committed by Junegunn Choi
Browse files

[vim] Reset window sizes on close

Fix #520
Fix junegunn/fzf.vim#42
parent f958c9da
No related branches found
No related tags found
No related merge requests found
......@@ -431,9 +431,11 @@ function! s:split(dict)
endfunction
function! s:execute_term(dict, command, temps) abort
let winrest = winrestcmd()
let [ppos, winopts] = s:split(a:dict)
let fzf = { 'buf': bufnr('%'), 'ppos': ppos, 'dict': a:dict, 'temps': a:temps,
\ 'winopts': winopts, 'command': a:command }
\ 'winopts': winopts, 'winrest': winrest, 'lines': &lines,
\ 'columns': &columns, 'command': a:command }
function! fzf.switch_back(inplace)
if a:inplace && bufnr('') == self.buf
" FIXME: Can't re-enter normal mode from terminal mode
......@@ -465,6 +467,10 @@ function! s:execute_term(dict, command, temps) abort
execute 'bd!' self.buf
endif
if &lines <= self.lines && &columns <= self.columns && s:getpos() == self.ppos
execute self.winrest
endif
if !s:exit_handler(a:code, self.command, 1)
return
endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment