mirror of
https://github.com/junegunn/goyo.vim.git
synced 2025-11-17 07:43:42 -05:00
Save settings before opening a new tab (#58)
Problem identified by @ches
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user