mirror of
https://github.com/junegunn/goyo.vim.git
synced 2025-11-14 22:33:49 -05:00
Add g:goyo_height and deprecate g:goyo_margin_{top,bottom}
This commit is contained in:
@@ -58,6 +58,7 @@ Configuration
|
|||||||
-------------
|
-------------
|
||||||
|
|
||||||
- `g:goyo_width` (default: 80)
|
- `g:goyo_width` (default: 80)
|
||||||
|
- `g:goyo_height` (default: 85%)
|
||||||
- `g:goyo_linenr` (default: 0)
|
- `g:goyo_linenr` (default: 0)
|
||||||
|
|
||||||
### Callbacks
|
### Callbacks
|
||||||
|
|||||||
@@ -374,12 +374,20 @@ function! s:relsz(expr, limit)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:parse_arg(arg)
|
function! s:parse_arg(arg)
|
||||||
let top = max([0, s:relsz(get(g:, 'goyo_margin_top', 4), &lines)])
|
if exists('g:goyo_height') || !exists('g:goyo_margin_top') && !exists('g:goyo_margin_bottom')
|
||||||
let bot = max([0, s:relsz(get(g:, 'goyo_margin_bottom', 4), &lines)])
|
let height = s:relsz(get(g:, 'goyo_height', '85%'), &lines)
|
||||||
|
let yoff = 0
|
||||||
|
else
|
||||||
|
let top = max([0, s:relsz(get(g:, 'goyo_margin_top', 4), &lines)])
|
||||||
|
let bot = max([0, s:relsz(get(g:, 'goyo_margin_bottom', 4), &lines)])
|
||||||
|
let height = &lines - top - bot
|
||||||
|
let yoff = top - bot
|
||||||
|
endif
|
||||||
|
|
||||||
let dim = { 'width': s:relsz(get(g:, 'goyo_width', 80), &columns),
|
let dim = { 'width': s:relsz(get(g:, 'goyo_width', 80), &columns),
|
||||||
\ 'height': &lines - top - bot,
|
\ 'height': height,
|
||||||
\ 'xoff': 0,
|
\ 'xoff': 0,
|
||||||
\ 'yoff': top - bot }
|
\ 'yoff': yoff }
|
||||||
if empty(a:arg)
|
if empty(a:arg)
|
||||||
return dim
|
return dim
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user