From cd419365265ba3f0901c9cd60e55a694a2de7494 Mon Sep 17 00:00:00 2001 From: Nikita Tikhomirov Date: Sun, 24 May 2026 11:33:56 +0300 Subject: [PATCH] gpui_wgpu: Bump cosmic-text to v0.19.0 (#56988) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Resolves the issues described at https://github.com/pop-os/cosmic-text/releases/tag/0.19.0 This fix addresses the characters '\u{001C}' | '\u{001D}' | '\u{001E}' | '\u{0085}' | '\u{2029}', which can cause the Editor gpui-component to crash, as these characters can cause the 'assert "left == right"'. Release Notes: - N/A --- Cargo.lock | 4 ++-- crates/gpui_wgpu/Cargo.toml | 4 ++-- crates/gpui_wgpu/src/cosmic_text_system.rs | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 43c2b961b8..c60f0d7dcf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3914,9 +3914,9 @@ dependencies = [ [[package]] name = "cosmic-text" -version = "0.17.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c5c9868e64aa6c5410629a83450e142c80e721c727a5bc0fb18107af6c2d66b" +checksum = "be17b688510d934ce13f48a2beba700e11583e281e0fda99c22bb256a14eda73" dependencies = [ "bitflags 2.10.0", "fontdb", diff --git a/crates/gpui_wgpu/Cargo.toml b/crates/gpui_wgpu/Cargo.toml index 51d187f82e..61a5746df3 100644 --- a/crates/gpui_wgpu/Cargo.toml +++ b/crates/gpui_wgpu/Cargo.toml @@ -20,7 +20,7 @@ gpui.workspace = true anyhow.workspace = true bytemuck = "1" collections.workspace = true -cosmic-text = "0.17.0" +cosmic-text = "0.19.0" etagere = "0.2" itertools.workspace = true log.workspace = true @@ -51,4 +51,4 @@ criterion.workspace = true [[bench]] name = "layout_line" -harness = false \ No newline at end of file +harness = false diff --git a/crates/gpui_wgpu/src/cosmic_text_system.rs b/crates/gpui_wgpu/src/cosmic_text_system.rs index 6c9e5e03d8..456ba59c0a 100644 --- a/crates/gpui_wgpu/src/cosmic_text_system.rs +++ b/crates/gpui_wgpu/src/cosmic_text_system.rs @@ -1,8 +1,8 @@ use anyhow::{Context as _, Ok, Result}; use collections::HashMap; use cosmic_text::{ - Attrs, AttrsList, Family, Font as CosmicTextFont, FontFeatures as CosmicFontFeatures, - FontSystem, ShapeBuffer, ShapeLine, + Attrs, AttrsList, Ellipsize, Family, Font as CosmicTextFont, + FontFeatures as CosmicFontFeatures, FontSystem, ShapeBuffer, ShapeLine, }; use gpui::{ Bounds, DevicePixels, Font, FontFallbacks, FontFeatures, FontId, FontMetrics, FontRun, GlyphId, @@ -544,6 +544,7 @@ impl CosmicTextSystemState { f32::from(font_size), None, // We do our own wrapping cosmic_text::Wrap::None, + Ellipsize::None, None, &mut layout_lines, None,