diff options
author | Jan Hrastnik | 2020-06-16 20:46:27 +0000 |
---|---|---|
committer | Jan Hrastnik | 2020-06-16 20:46:27 +0000 |
commit | 8958f06f0824965d030adc7522303129da014315 (patch) | |
tree | b2370940023d18363582c68819b6e1f55830cb0b /helix-term/src/editor.rs | |
parent | 8119f1ec3d690489869ab31c086c1f239b204d03 (diff) |
added file rendering
Diffstat (limited to 'helix-term/src/editor.rs')
-rw-r--r-- | helix-term/src/editor.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/helix-term/src/editor.rs b/helix-term/src/editor.rs index 1007dc36..3df84d6e 100644 --- a/helix-term/src/editor.rs +++ b/helix-term/src/editor.rs @@ -2,7 +2,8 @@ use crossterm::{ cursor, cursor::position, event::{self, read, Event, EventStream, KeyCode, KeyEvent}, - execute, queue, style, + execute, queue, + style::Print, terminal::{self, disable_raw_mode, enable_raw_mode}, }; use futures::{future::FutureExt, select, StreamExt}; @@ -39,6 +40,10 @@ impl Editor { fn render(&self) { // TODO: + match &self.state { + Some(s) => execute!(stdout(), cursor::MoveTo(0, 0), Print(s.file())).unwrap(), + None => (), + } } pub async fn print_events(&mut self) { |