From 92155aa762fe0c982f2f06e8ff761ec154b86fb5 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Thu, 19 Sep 2019 12:21:23 -0400 Subject: [PATCH] Fix the cursor issue! --- README.md | 2 +- src/editor.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c30a5b8..f7f0cc2 100644 --- a/README.md +++ b/README.md @@ -12,4 +12,4 @@ implemented in a more idiomatic Rust fashion. This generally simplifies dealing with the rules of Rust (borrow checker). ### Known issues: -* The cursor is invisible :( \ No newline at end of file +* Tab key does not expand to an indent diff --git a/src/editor.rs b/src/editor.rs index d3f94b9..af96328 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -1066,6 +1066,9 @@ impl Editor { // If you can't write to stdout, you might as well just panic handle.write_all(&self.output_buffer.as_bytes()).unwrap(); + + // Explicitly flush output so that the cursor actually appears correctly + io::stdout().flush().unwrap(); } /// Set the status bar message