Save settings before opening a new tab (#58)

Problem identified by @ches
This commit is contained in:
Junegunn Choi
2015-02-20 01:07:14 +09:00
parent b447d34143
commit 26f06e2272

View File

@@ -160,17 +160,7 @@ endfunction
function! s:goyo_on(width) function! s:goyo_on(width)
let s:orig_tab = tabpagenr() let s:orig_tab = tabpagenr()
let settings =
" New tab
tab split
let t:goyo_master = winbufnr(0)
let t:goyo_width = a:width
let t:goyo_margin_top = get(g:, 'goyo_margin_top', 4)
let t:goyo_margin_bottom = get(g:, 'goyo_margin_bottom', 4)
let t:goyo_initial_dim = [t:goyo_width, t:goyo_margin_top, t:goyo_margin_bottom]
let t:goyo_pads = {}
let t:goyo_revert =
\ { 'laststatus': &laststatus, \ { 'laststatus': &laststatus,
\ 'showtabline': &showtabline, \ 'showtabline': &showtabline,
\ 'fillchars': &fillchars, \ 'fillchars': &fillchars,
@@ -182,6 +172,17 @@ function! s:goyo_on(width)
\ 'sidescroll': &sidescroll, \ 'sidescroll': &sidescroll,
\ 'sidescrolloff': &sidescrolloff \ 'sidescrolloff': &sidescrolloff
\ } \ }
" New tab
tab split
let t:goyo_master = winbufnr(0)
let t:goyo_width = a:width
let t:goyo_margin_top = get(g:, 'goyo_margin_top', 4)
let t:goyo_margin_bottom = get(g:, 'goyo_margin_bottom', 4)
let t:goyo_initial_dim = [t:goyo_width, t:goyo_margin_top, t:goyo_margin_bottom]
let t:goyo_pads = {}
let t:goyo_revert = settings
let t:goyo_maps = extend(s:maps_nop(), s:maps_resize()) let t:goyo_maps = extend(s:maps_nop(), s:maps_resize())
if has('gui_running') if has('gui_running')
let t:goyo_revert.guioptions = &guioptions let t:goyo_revert.guioptions = &guioptions