tui: handle empty cells in cursor scan
When scanning the buffer for cursor position, also check empty cells. The cursor might be positioned at an empty cell (e.g., end of line or after all visible characters).
This commit is contained in:
parent
1fa298cbdd
commit
0f3edebcb3
1 changed files with 6 additions and 1 deletions
|
|
@ -838,12 +838,17 @@ impl App {
|
|||
// Count visible characters (skip zero-width and empty)
|
||||
if !symbol.is_empty() {
|
||||
if char_count == cursor_char_pos {
|
||||
// Found the cursor position
|
||||
// Found the cursor position - this is where the next char would go
|
||||
cursor_x = x;
|
||||
cursor_y = y;
|
||||
break;
|
||||
}
|
||||
char_count += 1;
|
||||
} else if char_count == cursor_char_pos {
|
||||
// Empty cell but we've reached the cursor position
|
||||
cursor_x = x;
|
||||
cursor_y = y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue