Skip to content

Commit 065f251

Browse files
h16rkimyakpoong
authored andcommitted
chore: update comments of truncate_safe_with_width
1 parent 2502d9d commit 065f251

File tree

1 file changed

+2
-2
lines changed
  • crates/chat-cli/src/cli/chat/util

1 file changed

+2
-2
lines changed

crates/chat-cli/src/cli/chat/util/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ use super::ChatError;
2121
use super::token_counter::TokenCounter;
2222

2323
/// Truncates text to a maximum display width.
24-
/// Takes into account the display width of characters, where CJK characters are counted as 2 units
25-
/// wide. Returns the truncated text without ellipsis.
24+
/// Dynamically calculate the display width of characters, where CJK characters are counted as 2
25+
/// units wide instead of 1.
2626
pub fn truncate_safe_with_width(text: &str, max_width: usize) -> String {
2727
let text_width = UnicodeWidthStr::width(text);
2828
if text_width <= max_width {

0 commit comments

Comments
 (0)