summaryrefslogtreecommitdiffstats
path: root/src/widget.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/widget.rs')
-rw-r--r--src/widget.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/widget.rs b/src/widget.rs
index ccf8f72..d41900f 100644
--- a/src/widget.rs
+++ b/src/widget.rs
@@ -1,6 +1,7 @@
use termion::event::{Event, Key, MouseEvent};
use crate::coordinates::{Coordinates, Position, Size};
+use crate::fail::HResult;
use std::io::{BufWriter, Write};
@@ -48,7 +49,7 @@ pub trait Widget {
crate::window::show_status(status);
}
- fn minibuffer(&self, query: &str) -> Option<String> {
+ fn minibuffer(&self, query: &str) -> HResult<String> {
crate::window::minibuffer(query)
}
@@ -115,6 +116,15 @@ pub trait Widget {
.collect()
}
+ fn draw(&self) -> HResult<()> {
+ let drawlist = self.get_drawlist();
+ let mut bufout = BufWriter::new(std::io::stdout());
+
+ write!(bufout, "{}", drawlist)?;
+ bufout.flush()?;
+ Ok(())
+ }
+
fn animate_slide_up(&mut self) {
let coords = self.get_coordinates().clone();
let xpos = coords.position().x();