summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorandromeda <andromeda@lenovo>2026-04-15 12:01:53 +0200
committerandromeda <andromeda@lenovo>2026-04-15 12:01:53 +0200
commit2dbe2c78114e446fe1ed31c071cb323239059e58 (patch)
tree87bf9f700c384c660de1cc9a147cf326fd5dd20a /src/main.rs
parenta6afe8626b7b2f85fb3137c7dae51774b3fd39b9 (diff)
fix bug
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs11
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) {