Closed lervag closed 9 years ago
Thanks for the report. I currently don't have access to a linux desktop, I will check when I get a chance. (From what I can tell it's not reproducible on MacVim.)
I'm not surprised if it is not reproducible on MacVim, which even allows to set fullscreen mode from inside vim. In any case, let me know if there is anything I can do to help.
Which distro are you running?
I'm on Arch linux and I use xfce4.
Which distro are you running?
— Reply to this email directly or view it on GitHub https://github.com/junegunn/goyo.vim/issues/43#issuecomment-55750968.
I managed to set up an Arch VM with xfce4, but I couldn't reproduce the problem. (However, I ran into a different problem where "height" instead of width shrinks by a few lines. But it seemed like a bug of GVim itself, as it was easily reproducible with tab split
without Goyo)
Could you try it without any other plugins and settings?
gvim -Nu <(echo 'set rtp+=~/.vim/bundle/goyo.vim')
Ah, I'm very sorry, I should of course have tested a minimal example first. I should at the very least have tested the example I described initially!
My problem is due to the use of a different plugin vim-fontsize
that I use inside the goyo_enter
function to increase the font size. I do not understand why the problem occur. I'll investigate further on my own, and in the inprobable case that there is something wrong with Goyo I'll reopen the issue.
Ok, so I managed to find a simple example that fails without using external plugins. Personally I use the Inconsolata-g\ Medium
font, but since you might use other fonts I chose to let you choose the font yourself. In any case, if you use the following goyo_enter
function where the font size is increased with set guifont
, the problem should be reproducible.
function! s:goyo_enter()
set guifont=<selected font> 11
endfunction
What happens when you add nested
to the autocmd statements like so? Does it help?
autocmd User GoyoEnter nested call <SID>goyo_enter()
autocmd User GoyoLeave nested call <SID>goyo_leave()
Goyo re-adjusts the sizes of the windows on VimResized event which should be invoked on set guifont
.
I recently updated README page to encourage the use of nested
flag.
https://github.com/junegunn/goyo.vim/commit/9eadf29430af9e98247f8e22c9103a9c74aa5a17
Yes, with nested
the issue is solved. Thanks!
If I open
gvim
, go to fullscreen mode, issue:Goyo
, then the window with becomes much less than the default 80. If I instead issue:Goyo
before I go to fullscreen mode, then it works as expected.My
vimrc
settings are:Note that the current workaround works (although it should not be necessary):