From 8958f06f0824965d030adc7522303129da014315 Mon Sep 17 00:00:00 2001 From: Jan Hrastnik Date: Tue, 16 Jun 2020 22:46:27 +0200 Subject: added file rendering --- helix-term/src/editor.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'helix-term/src') 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) { -- cgit v1.2.3-70-g09d2