diff options
| author | andromeda <andromeda@lenovo> | 2026-04-15 12:01:53 +0200 |
|---|---|---|
| committer | andromeda <andromeda@lenovo> | 2026-04-15 12:01:53 +0200 |
| commit | 2dbe2c78114e446fe1ed31c071cb323239059e58 (patch) | |
| tree | 87bf9f700c384c660de1cc9a147cf326fd5dd20a | |
| parent | a6afe8626b7b2f85fb3137c7dae51774b3fd39b9 (diff) | |
fix bug
| -rw-r--r-- | src/main.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 0e50df8..a718a90 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use anki_bridge::{AnkiClient, AnkiRequestable, prelude::*}; use crossterm::{ - cursor::*, + cursor, event::{self, Event, KeyCode}, execute, style::*, @@ -48,6 +48,8 @@ fn init(anki: &AnkiClient) { } fn prompt(anki: &AnkiClient) { + // needs to be done twice to account for lag on the other end + anki.request(GuiCurrentCardRequest {}).unwrap(); let card = anki.request(GuiCurrentCardRequest {}).unwrap(); clear_screen(); display_html(&card.question); @@ -83,7 +85,12 @@ fn prompt(anki: &AnkiClient) { } fn clear_screen() { - execute!(stdout(), Clear(ClearType::All), MoveTo(0, 0)); + execute!( + stdout(), + Clear(ClearType::All), + cursor::MoveTo(0, 0), + cursor::Hide + ); } fn display_prompt_text(text: &str) { |
