resize_pads exits early if no padding has been initialized #187
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there, this is a simple, somewhat hacky fix for a problem I ran into when initializing Goyo.
The problem I was running into was that I had an autocmd in my
.vimrc
to resize the windows to be evenly split on aWinEnter
event. This lead to problems that I don't quite understand whereresize_pads
was called withininit_pads
; I don't understand it because it looks like Goyo doesn't add the autocmd forresize_pads
until afterinit_pads
, but somehow this got called anyways even on a fresh start of vim.My fix to this was just to add a flag to verify that all
init_pad
calls have been run; if they haven't been, resize_pad returns without resizing.If you want to make a less hacky fix than the one I have here, I ran into this problem on neovim 0.3.1. The window resizing I am doing is somewhat indirect so that may also matter: I call a command from another plugin that happens to resize the windows in a specific way (
<Plug>(repl-resize)
in https://github.com/haberdashPI/vim-multi-repl).