@@ -64,7 +64,7 @@ function! s:setup_pad(bufnr, vert, size)
6464 execute win . ' wincmd w'
6565 execute (a: vert ? ' vertical ' : ' ' ) . ' resize ' . max ([0 , a: size ])
6666 augroup goyop
67- autocmd WinEnter <buffer> call s: blank ()
67+ autocmd WinEnter , CursorMoved <buffer> call s: blank ()
6868 augroup END
6969
7070 " To hide scrollbars of pad windows in GVim
@@ -127,6 +127,7 @@ function! s:goyo_on(width)
127127 \ { ' laststatus' : &laststatus ,
128128 \ ' showtabline' : &showtabline ,
129129 \ ' fillchars' : &fillchars ,
130+ \ ' winminwidth' : &winminwidth ,
130131 \ ' winwidth' : &winwidth ,
131132 \ ' winminheight' : &winminheight ,
132133 \ ' winheight' : &winheight ,
@@ -145,6 +146,12 @@ function! s:goyo_on(width)
145146 silent ! GitGutterDisable
146147 endif
147148
149+ " vim-signify
150+ let t :goyo_disabled_signify = exists (' b:sy' ) && b: sy .active
151+ if t :goyo_disabled_signify
152+ SignifyToggle
153+ endif
154+
148155 " vim-airline
149156 let t :goyo_disabled_airline = exists (" #airline" )
150157 if t :goyo_disabled_airline
@@ -177,10 +184,10 @@ function! s:goyo_on(width)
177184 endif
178185
179186 " Global options
180- set winwidth = 1
181187 let &winheight = max ([&winminheight , 1 ])
182188 set winminheight = 1
183189 set winheight = 1
190+ set winminwidth = 1 winwidth = 1
184191 set laststatus = 0
185192 set showtabline = 0
186193 set noruler
@@ -241,6 +248,7 @@ function! s:goyo_off()
241248
242249 let goyo_revert = t :goyo_revert
243250 let goyo_disabled_gitgutter = t :goyo_disabled_gitgutter
251+ let goyo_disabled_signify = t :goyo_disabled_signify
244252 let goyo_disabled_airline = t :goyo_disabled_airline
245253 let goyo_disabled_powerline = t :goyo_disabled_powerline
246254 let goyo_disabled_lightline = t :goyo_disabled_lightline
@@ -258,6 +266,10 @@ function! s:goyo_off()
258266 execute printf (' normal! %dG%d|' , line , col )
259267 endif
260268
269+ let wmw = remove (goyo_revert, ' winminwidth' )
270+ let ww = remove (goyo_revert, ' winwidth' )
271+ let &winwidth = ww
272+ let &winminwidth = wmw
261273 let wmh = remove (goyo_revert, ' winminheight' )
262274 let wh = remove (goyo_revert, ' winheight' )
263275 let &winheight = max ([wmh , 1 ])
@@ -273,6 +285,12 @@ function! s:goyo_off()
273285 silent ! GitGutterEnable
274286 endif
275287
288+ if goyo_disabled_signify
289+ silent ! if ! b: sy .active
290+ SignifyToggle
291+ endif
292+ endif
293+
276294 if goyo_disabled_airline && ! exists (" #airline" )
277295 AirlineToggle
278296 silent ! AirlineRefresh
@@ -296,20 +314,26 @@ function! s:goyo_off()
296314 endif
297315endfunction
298316
299- function ! s: goyo (... )
317+ function ! s: goyo (bang , ... )
300318 let width = a: 0 > 0 ? a: 1 : get (g: , ' goyo_width' , 80 )
301319
302- if exists (' #goyo' ) == 0
303- call s: goyo_on (width)
304- elseif a: 0 > 0
305- let t :goyo_width = width
306- call s: resize_pads ()
320+ if a: bang
321+ if exists (' #goyo' )
322+ call s: goyo_off ()
323+ endif
307324 else
308- call s: goyo_off ()
325+ if exists (' #goyo' ) == 0
326+ call s: goyo_on (width)
327+ elseif a: 0 > 0
328+ let t :goyo_width = width
329+ call s: resize_pads ()
330+ else
331+ call s: goyo_off ()
332+ end
309333 end
310334endfunction
311335
312- command ! -nargs =? Goyo call s: goyo (<args> )
336+ command ! -nargs =? - bar - bang Goyo call s: goyo (' <bang> ' == ' ! ' , <args> )
313337
314338let &cpo = s: cpo_save
315339unlet s: cpo_save
0 commit comments