This commit is contained in:
Timon_Post 2019-05-13 22:36:28 +02:00 committed by Florian Dehau
parent 5645d0de03
commit f6a0a91a23
2 changed files with 4 additions and 35 deletions

View file

@ -1,29 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<Objective-C-extensions>
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
</file>
<class>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
</class>
<extensions>
<pair source="cpp" header="h" fileNamingConvention="NONE" />
<pair source="c" header="h" fileNamingConvention="NONE" />
</extensions>
</Objective-C-extensions>
</code_scheme>
</component>

View file

@ -1,14 +1,14 @@
use std::io;
use crate::backend::Backend;
use crate::{buffer::Cell, layout::Rect};
use crate::style::{Color, Modifier};
use crossterm::{ErrorKind, Crossterm};
use crate::{buffer::Cell, layout::Rect};
use crossterm::{Crossterm, ErrorKind};
use std::io::{stdout, Write};
pub struct CrosstermBackend {
alternate_screen: Option<crossterm::AlternateScreen>,
crossterm: Crossterm
crossterm: Crossterm,
}
impl Default for CrosstermBackend {
@ -65,9 +65,7 @@ fn convert_error(error: ErrorKind) -> io::Error {
impl Backend for CrosstermBackend {
fn clear(&mut self) -> io::Result<()> {
let terminal = self.crossterm.terminal();
terminal
.clear(crossterm::ClearType::All)
.map_err(convert_error)?;
terminal.clear(crossterm::ClearType::All)?;
Ok(())
}