From 26f06e22729a80e61535ba772253cac7bc2c93a0 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Fri, 20 Feb 2015 01:07:14 +0900 Subject: [PATCH] Save settings before opening a new tab (#58) Problem identified by @ches --- autoload/goyo.vim | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/autoload/goyo.vim b/autoload/goyo.vim index e4a904f..b790e89 100644 --- a/autoload/goyo.vim +++ b/autoload/goyo.vim @@ -160,6 +160,18 @@ endfunction function! s:goyo_on(width) let s:orig_tab = tabpagenr() + let settings = + \ { 'laststatus': &laststatus, + \ 'showtabline': &showtabline, + \ 'fillchars': &fillchars, + \ 'winminwidth': &winminwidth, + \ 'winwidth': &winwidth, + \ 'winminheight': &winminheight, + \ 'winheight': &winheight, + \ 'ruler': &ruler, + \ 'sidescroll': &sidescroll, + \ 'sidescrolloff': &sidescrolloff + \ } " New tab tab split @@ -170,18 +182,7 @@ function! s:goyo_on(width) 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, - \ 'showtabline': &showtabline, - \ 'fillchars': &fillchars, - \ 'winminwidth': &winminwidth, - \ 'winwidth': &winwidth, - \ 'winminheight': &winminheight, - \ 'winheight': &winheight, - \ 'ruler': &ruler, - \ 'sidescroll': &sidescroll, - \ 'sidescrolloff': &sidescrolloff - \ } + let t:goyo_revert = settings let t:goyo_maps = extend(s:maps_nop(), s:maps_resize()) if has('gui_running') let t:goyo_revert.guioptions = &guioptions