Need to reduce winheight before setting winminheight (#13)

This commit is contained in:
Junegunn Choi
2014-01-01 08:53:53 +09:00
parent 41407af3da
commit adb6fff7d0

View File

@@ -170,6 +170,7 @@ function! s:goyo_on(width)
" Global options " Global options
set winwidth=1 set winwidth=1
let &winheight = max([&winminheight, 1])
set winminheight=1 set winminheight=1
set winheight=1 set winheight=1
set laststatus=0 set laststatus=0
@@ -242,6 +243,12 @@ function! s:goyo_off()
endif endif
tabclose tabclose
let wmh = remove(goyo_revert, 'winminheight')
let wh = remove(goyo_revert, 'winheight')
let &winheight = max([wmh, 1])
let &winminheight = wmh
let &winheight = wh
for [k, v] in items(goyo_revert) for [k, v] in items(goyo_revert)
execute printf("let &%s = %s", k, string(v)) execute printf("let &%s = %s", k, string(v))
endfor endfor