From 8d2af4e046c2a95dfc54aafd6f88da12389d76e8 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Fri, 17 Jul 2026 03:26:33 +0300 Subject: perf: adopt libghostty integration improvements refs #276 --- src/app/actions.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/app/actions.rs') diff --git a/src/app/actions.rs b/src/app/actions.rs index 68286952..3fedeeb3 100644 --- a/src/app/actions.rs +++ b/src/app/actions.rs @@ -11,7 +11,6 @@ use crate::layout::{find_in_direction, NavDirection}; use crate::selection::Selection; use crate::terminal::{EffectiveStateChange, TerminalStateMutation}; use crate::workspace::WorkspaceGitStatus; -use unicode_width::UnicodeWidthChar; use super::state::{ text_matches_query, AgentNotificationDelivery, AppState, Mode, NavigatorRow, @@ -2220,7 +2219,7 @@ pub(crate) fn visible_text_cells(text: &str, pane_width: u16) -> Vec Vec { let mut next_col = 0u16; row.chars() .map(|ch| { - let width = UnicodeWidthChar::width(ch).unwrap_or(0) as u16; + let width = u16::from(crate::ghostty::unicode_codepoint_width(ch as u32)); let start_col = if width == 0 { next_col.saturating_sub(1) } else { @@ -3190,7 +3189,7 @@ mod tests { let prefix = &row[..byte_idx]; prefix .chars() - .map(|ch| UnicodeWidthChar::width(ch).unwrap_or(0) as u16) + .map(|ch| u16::from(crate::ghostty::unicode_codepoint_width(ch as u32))) .sum() } -- cgit v1.2.3