Add input focus element
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Isaac Mills 2025-07-23 09:13:02 -06:00
parent 6175cb9ee8
commit 9f96bd6cd1
Signed by: fnmain
GPG key ID: B67D7410F33A0F61
2 changed files with 6 additions and 1 deletions

@ -1 +1 @@
Subproject commit 782758189e42c3bea7f72dd2d55d801c4a5748c1 Subproject commit 9747c151bc39fe940f3bf82a46775c7f50b71d32

View file

@ -150,6 +150,7 @@ impl App {
); );
frame.render_widget(&self.binary_search_hint, layout[1]); frame.render_widget(&self.binary_search_hint, layout[1]);
let mut cursor_set = false;
for (block, num) in layout_code_blocks.iter().copied().zip( for (block, num) in layout_code_blocks.iter().copied().zip(
self.binary_search_hint self.binary_search_hint
.numbers_guessed .numbers_guessed
@ -157,6 +158,10 @@ impl App {
.map(|num| Cow::Owned(format!("{}", *num))) .map(|num| Cow::Owned(format!("{}", *num)))
.chain(std::iter::repeat(Cow::Borrowed(" "))), .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( frame.render_widget(
Paragraph::new(num) Paragraph::new(num)
.block(Block::new().borders(Borders::all())) .block(Block::new().borders(Borders::all()))