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.
Currently image.nvim does not have a way to detect that an image changed since the last time it was rendered. This PR should address that case.
I've added added a check for the
date:modify
property which will clear the image and force a re-render when it has been modified since the last render.It seems that the initialization of
self.resize_hash
was duplicated so I've renamed one of them toself.date_hash
.I've modified the cache and tmp files generated, which will now also have the modification date of the file.
Here's the behavior of the
master
branch right now:https://github.com/3rd/image.nvim/assets/31407988/c258801f-ac85-491b-a7b3-e2dadcefb0ad
Note that it is necessary to open and close nvim in order for it to render the updated image (I think closing the buffer and reopening also works)
And here the behavior with these changes:
https://github.com/3rd/image.nvim/assets/31407988/c43c1e1f-b658-4d0b-8f8e-b804adfb3b55