Buggy Unicode Support #246

Closed
opened 2025-10-14 15:43:39 -06:00 by navan · 0 comments
Owner

Originally created by @d34db3ff on 5/26/2024

The cursor does not align correctly with user input when typing certain Unicode characters, such as Chinese characters or emojis. This issue appears to be caused by the presence of certain Unicode characters in the buffer, which results in get_term_cursor() returning an incorrect value.

main.rs: 321
if let Some((cx, cy)) = sstate.get_term_cursor() {
                if let Some(c) = cursor {
                    let style = Style::default().fg(Color::Green);
                    let span = Span::styled(c.to_string(), style);
                    let para = Paragraph::new(span);
                    let inner = Rect::new(cx, cy, 1, 1);
                    f.render_widget(para, inner)
                }
                f.set_cursor(cx, cy);
}

*Originally created by @d34db3ff on 5/26/2024* The cursor does not align correctly with user input when typing certain Unicode characters, such as Chinese characters or emojis. This issue appears to be caused by the presence of certain Unicode characters in the buffer, which results in get_term_cursor() returning an incorrect value. ``` main.rs: 321 if let Some((cx, cy)) = sstate.get_term_cursor() { if let Some(c) = cursor { let style = Style::default().fg(Color::Green); let span = Span::styled(c.to_string(), style); let para = Paragraph::new(span); let inner = Rect::new(cx, cy, 1, 1); f.render_widget(para, inner) } f.set_cursor(cx, cy); } ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/iamb#246
No description provided.