Repository navigation
fix: preserve and restore images across tab switches - #387
Open
WilliamHsieh wants to merge 1 commit into
Open
WilliamHsieh wants to merge 1 commit into
WilliamHsieh wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Images created through
from_file()with a window binding disappear permanently after switching to another tab and returning. The tab-change cleanup callsclear()even though the original window still exists, removing the image from the backend registry. API consumers that keep the original Image object then have nothing for the normal redraw path to discover.Use a shallow clear for windows outside the current tab, restore the current tab's bound images on
TabEnter, and continue through all images instead of returning after the first hidden or invalid window. Closed windows and mismatched buffers still discard their images; explicitly cleared images stay cleared.Reproduced independently of LeetCode and terminal multiplexers with
nvim -u NONE -i NONE, all integrations disabled, the Kitty backend,magick_cli, and the localtests/test_data/100x100.pngfixture. Render it withwindowandbufferbound, switch to another tab, and return without callingrender()again:1/true→0/false→0/false.1/true→1/false→1/true.Validation:
nix develop --command busted tests/: 101 successes, 0 failures, 0 errors.stylua --check lua/image/init.lua tests/core/tab_switch_spec.luaandgit diff --checkpass.