mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-24 01:46:31 +00:00
Take &self
in TermionBackend::clear()
This commit is contained in:
parent
ad7606ca55
commit
686de0831c
@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
use ::backend;
|
use ::backend;
|
||||||
use ::event::{Event, Key};
|
use ::event::{Event, Key};
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
@ -15,18 +13,19 @@ pub struct TermionBackend {
|
|||||||
impl backend::Backend for TermionBackend {
|
impl backend::Backend for TermionBackend {
|
||||||
fn init() -> Self {
|
fn init() -> Self {
|
||||||
print!("{}", termion::cursor::Hide);
|
print!("{}", termion::cursor::Hide);
|
||||||
Self::clear();
|
|
||||||
|
|
||||||
|
let backend = TermionBackend {
|
||||||
TermionBackend {
|
|
||||||
terminal: ::std::io::stdout().into_raw_mode().unwrap(),
|
terminal: ::std::io::stdout().into_raw_mode().unwrap(),
|
||||||
}
|
};
|
||||||
|
|
||||||
|
backend.clear();
|
||||||
|
backend
|
||||||
}
|
}
|
||||||
|
|
||||||
fn finish(&mut self) {
|
fn finish(&mut self) {
|
||||||
// Maybe we should clear everything?
|
// Maybe we should clear everything?
|
||||||
print!("{}{}", termion::cursor::Show, termion::cursor::Goto(1, 1));
|
print!("{}{}", termion::cursor::Show, termion::cursor::Goto(1, 1));
|
||||||
Self::clear();
|
self.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn init_color_style(&mut self, style: ColorStyle, foreground: &Color,
|
fn init_color_style(&mut self, style: ColorStyle, foreground: &Color,
|
||||||
@ -58,7 +57,7 @@ impl backend::Backend for TermionBackend {
|
|||||||
(x as usize, y as usize)
|
(x as usize, y as usize)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn clear() {
|
fn clear(&self) {
|
||||||
print!("{}", termion::clear::All);
|
print!("{}", termion::clear::All);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user