Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kitty Image Protocol - don't remove images with ID 0 #2761

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions term/src/terminalstate/kitty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ impl KittyImageState {
}

fn record_id_to_data(&mut self, image_id: u32, data: Arc<ImageData>) {
self.remove_data_for_id(image_id);
if image_id != 0 {
self.remove_data_for_id(image_id);
}
self.prune_unreferenced();
self.used_memory += data.len();
self.id_to_data.insert(image_id, data);
Expand Down Expand Up @@ -97,7 +99,9 @@ impl TerminalState {
placement,
verbosity
);
self.kitty_remove_placement(image_id, placement.placement_id);
if image_id != 0 {
self.kitty_remove_placement(image_id, placement.placement_id);
}
let img = Arc::clone(self.kitty_img.id_to_data.get(&image_id).ok_or_else(|| {
anyhow::anyhow!(
"no matching image id {} in id_to_data for image_number {:?}",
Expand Down