From 2dbe2c78114e446fe1ed31c071cb323239059e58 Mon Sep 17 00:00:00 2001 From: andromeda Date: Wed, 15 Apr 2026 12:01:53 +0200 Subject: [PATCH] fix bug --- src/main.rs | 11 +++++++++-- 1 file 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) {