mirror of
https://github.com/junegunn/goyo.vim.git
synced 2025-11-08 11:23:51 -05:00
Hide statusline on WinEnter and WinLeave
This commit is contained in:
@@ -64,7 +64,8 @@ function! s:setup_pad(bufnr, vert, size)
|
|||||||
execute win . 'wincmd w'
|
execute win . 'wincmd w'
|
||||||
execute (a:vert ? 'vertical ' : '') . 'resize ' . max([0, a:size])
|
execute (a:vert ? 'vertical ' : '') . 'resize ' . max([0, a:size])
|
||||||
augroup goyop
|
augroup goyop
|
||||||
autocmd WinEnter,CursorMoved <buffer> call s:blank()
|
autocmd WinEnter,CursorMoved <buffer> nested call s:blank()
|
||||||
|
autocmd WinLeave <buffer> call s:hide_statusline()
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" To hide scrollbars of pad windows in GVim
|
" To hide scrollbars of pad windows in GVim
|
||||||
@@ -114,6 +115,10 @@ function! s:tranquilize()
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:hide_statusline()
|
||||||
|
let &l:statusline = repeat(' ', winwidth(0))
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:goyo_on(width)
|
function! s:goyo_on(width)
|
||||||
let s:orig_tab = tabpagenr()
|
let s:orig_tab = tabpagenr()
|
||||||
|
|
||||||
@@ -131,7 +136,6 @@ function! s:goyo_on(width)
|
|||||||
\ 'winwidth': &winwidth,
|
\ 'winwidth': &winwidth,
|
||||||
\ 'winminheight': &winminheight,
|
\ 'winminheight': &winminheight,
|
||||||
\ 'winheight': &winheight,
|
\ 'winheight': &winheight,
|
||||||
\ 'statusline': &statusline,
|
|
||||||
\ 'ruler': &ruler,
|
\ 'ruler': &ruler,
|
||||||
\ 'sidescroll': &sidescroll,
|
\ 'sidescroll': &sidescroll,
|
||||||
\ 'sidescrolloff': &sidescrolloff
|
\ 'sidescrolloff': &sidescrolloff
|
||||||
@@ -211,16 +215,16 @@ function! s:goyo_on(width)
|
|||||||
call s:resize_pads()
|
call s:resize_pads()
|
||||||
call s:tranquilize()
|
call s:tranquilize()
|
||||||
|
|
||||||
let &statusline = repeat(' ', winwidth(0))
|
|
||||||
|
|
||||||
augroup goyo
|
augroup goyo
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufWinLeave <buffer> call s:goyo_off()
|
autocmd BufWinLeave <buffer> call s:goyo_off()
|
||||||
autocmd TabLeave * call s:goyo_off()
|
autocmd TabLeave * call s:goyo_off()
|
||||||
autocmd VimResized * call s:resize_pads()
|
autocmd VimResized * call s:resize_pads()
|
||||||
autocmd ColorScheme * call s:tranquilize()
|
autocmd ColorScheme * call s:tranquilize()
|
||||||
|
autocmd WinEnter,WinLeave <buffer> call s:hide_statusline()
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
|
call s:hide_statusline()
|
||||||
if exists('g:goyo_callbacks[0]')
|
if exists('g:goyo_callbacks[0]')
|
||||||
call g:goyo_callbacks[0]()
|
call g:goyo_callbacks[0]()
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user