diff --git a/poc-agent/src/tui.rs b/poc-agent/src/tui.rs index a616dd3..88b095f 100644 --- a/poc-agent/src/tui.rs +++ b/poc-agent/src/tui.rs @@ -829,6 +829,7 @@ impl App { let mut char_count = 0usize; let mut cursor_x = input_area.x; let mut cursor_y = input_area.y; + let mut found = false; // Walk through the rendered buffer, counting characters until we reach the cursor position for y in input_area.y..input_area.y + input_area.height { @@ -841,6 +842,7 @@ impl App { // Found the cursor position - this is where the next char would go cursor_x = x; cursor_y = y; + found = true; break; } char_count += 1; @@ -848,12 +850,13 @@ impl App { // Empty cell but we've reached the cursor position cursor_x = x; cursor_y = y; + found = true; break; } } } - if cursor_x != input_area.x || cursor_y != input_area.y { - break; // Found it + if found { + break; } }