From ac3ac43c2be9dcb4e8f009ba5155ce5b8ac46184 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 6 Mar 2021 12:56:36 -0800 Subject: [PATCH] warn instead of panic if there's already something assigned I saw this trigger and couldn't repro; I want to understand it better when it next occurs. --- wezterm-gui/src/shapecache.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/wezterm-gui/src/shapecache.rs b/wezterm-gui/src/shapecache.rs index 83107000a..e604e80d8 100644 --- a/wezterm-gui/src/shapecache.rs +++ b/wezterm-gui/src/shapecache.rs @@ -83,7 +83,16 @@ where prior_info.replace(info); if glyph.texture.is_some() { - assert!(pos[idx].is_none()); + if let Some(existing) = pos.get(idx) { + log::warn!( + "idx={} is already assigned to {:#?} in: {:#?}. infos={:#?}, glyphs={:#?}", + idx, + existing, + pos, + infos, + glyphs + ); + } let bitmap_pixel_width = glyph .texture .as_ref()