Fix: Attempted fix for fireplace not resizing easily #33
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.
I noticed that my fireplace wasn't resizing dynamically very easily,
and whislt this wasn't really a big deal, I got curious and had a look.
I want my fireplace to be cozy! <3
The actual offending line is rather
Line 244:
'(add-hook 'window-size-change-functions 'fireplace--update-locals-vars nil t)'
As per the documentation the
'Functions called during redisplay when window sizes have changed.
The value should be a list of functions that take one argument.'
So that's all the problem is, the function is being called with an argument it
isn't expecting, the documentation states it passes the window as an argument.
But here we don't care about that, so I just added a 'stub-window' to 'eat' the
argument.
Although, it occurs to me this might be a bit lazy, and I could quite easily use the passed
argument to update the fileplace vars, instead of searching for the (hardcoded) buffer every time.
But hey, it works.
Also here I used &optional because of that one other time when the
update-vars function is called, but again, this could easily be adaopted
to supply the window context properly.
EDIT:
I should note that I've been using this fix for a solid year or something, by straight overriding the
function with a nearly identical copy of 7296ced in my 'init.el'.
It should work just fine.