From 6e13e974b047ee464ecfe6d9c23a9cc27715f7e1 Mon Sep 17 00:00:00 2001 From: 依云 Date: Tue, 18 Nov 2025 11:26:33 +0800 Subject: fix: highlight the correct place when multibyte characters are involved (#2965) ## Checks - [x] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [x] I have checked that there are no existing pull requests for the same thing --- crates/atuin/src/command/client/search/history_list.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/atuin/src/command/client/search/history_list.rs b/crates/atuin/src/command/client/search/history_list.rs index 899308db..47a7d9dc 100644 --- a/crates/atuin/src/command/client/search/history_list.rs +++ b/crates/atuin/src/command/client/search/history_list.rs @@ -273,8 +273,9 @@ impl DrawState<'_> { } style.attributes.set(style::Attribute::Bold); } - self.draw(&ch.to_string(), style.into()); - pos += 1; + let s = ch.to_string(); + self.draw(&s, style.into()); + pos += s.len(); } pos += 1; } -- cgit v1.3.1