From 9f96bd6cd15d1ece2f9c53fda85240b35f4a7095 Mon Sep 17 00:00:00 2001 From: Isaac Mills Date: Wed, 23 Jul 2025 09:13:02 -0600 Subject: [PATCH] Add input focus element --- thecockpit/ratzilla | 2 +- thecockpit/src/app.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/thecockpit/ratzilla b/thecockpit/ratzilla index 7827581..9747c15 160000 --- a/thecockpit/ratzilla +++ b/thecockpit/ratzilla @@ -1 +1 @@ -Subproject commit 782758189e42c3bea7f72dd2d55d801c4a5748c1 +Subproject commit 9747c151bc39fe940f3bf82a46775c7f50b71d32 diff --git a/thecockpit/src/app.rs b/thecockpit/src/app.rs index 9a4ca53..c08d7d6 100644 --- a/thecockpit/src/app.rs +++ b/thecockpit/src/app.rs @@ -150,6 +150,7 @@ impl App { ); frame.render_widget(&self.binary_search_hint, layout[1]); + let mut cursor_set = false; for (block, num) in layout_code_blocks.iter().copied().zip( self.binary_search_hint .numbers_guessed @@ -157,6 +158,10 @@ impl App { .map(|num| Cow::Owned(format!("{}", *num))) .chain(std::iter::repeat(Cow::Borrowed(" "))), ) { + if !cursor_set && num == " " && self.current_effect.done() { + frame.set_cursor_position((block.x + 1, block.y + 1)); + cursor_set = true; + } frame.render_widget( Paragraph::new(num) .block(Block::new().borders(Borders::all()))