Fix winminwidth issue (#35)

This commit is contained in:
Junegunn Choi
2014-07-03 23:37:29 +09:00
parent f303dc9307
commit 7e318dbcce

View File

@@ -127,6 +127,7 @@ function! s:goyo_on(width)
\ { 'laststatus': &laststatus, \ { 'laststatus': &laststatus,
\ 'showtabline': &showtabline, \ 'showtabline': &showtabline,
\ 'fillchars': &fillchars, \ 'fillchars': &fillchars,
\ 'winminwidth': &winminwidth,
\ 'winwidth': &winwidth, \ 'winwidth': &winwidth,
\ 'winminheight': &winminheight, \ 'winminheight': &winminheight,
\ 'winheight': &winheight, \ 'winheight': &winheight,
@@ -177,10 +178,10 @@ function! s:goyo_on(width)
endif endif
" Global options " Global options
set winwidth=1
let &winheight = max([&winminheight, 1]) let &winheight = max([&winminheight, 1])
set winminheight=1 set winminheight=1
set winheight=1 set winheight=1
set winminwidth=1 winwidth=1
set laststatus=0 set laststatus=0
set showtabline=0 set showtabline=0
set noruler set noruler
@@ -258,6 +259,10 @@ function! s:goyo_off()
execute printf('normal! %dG%d|', line, col) execute printf('normal! %dG%d|', line, col)
endif endif
let wmw = remove(goyo_revert, 'winminwidth')
let ww = remove(goyo_revert, 'winwidth')
let &winwidth = ww
let &winminwidth = wmw
let wmh = remove(goyo_revert, 'winminheight') let wmh = remove(goyo_revert, 'winminheight')
let wh = remove(goyo_revert, 'winheight') let wh = remove(goyo_revert, 'winheight')
let &winheight = max([wmh, 1]) let &winheight = max([wmh, 1])