Skip to content

Commit

Permalink
fixed indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Znackt committed Jul 8, 2024
1 parent 0ed546b commit 23abd90
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub struct Editor {

impl Editor {
pub fn default() -> Self {
Editor {should_quit: false}
Editor { should_quit: false }
}
pub fn run(&mut self) {
if let Err(err) = self.repl() {
Expand All @@ -19,10 +19,15 @@ impl Editor {
enable_raw_mode()?;
loop {
if let Key(KeyEvent {
code, modifiers, kind, state
code,
modifiers,
kind,
state,
}) = read()?
{
println!("Code: {code:?} Modifiers: {modifiers:?} Kind: {kind:?} State: {state:?} \r");
println!(
"Code: {code:?} Modifiers: {modifiers:?} Kind: {kind:?} State: {state:?} \r"
);
match code {
Char('q') if modifiers == KeyModifiers::CONTROL => {
self.should_quit = true;
Expand All @@ -31,10 +36,10 @@ impl Editor {
}
if self.should_quit {
break;
}
}
}
}
disable_raw_mode()?;
Ok(())
}
}
}

0 comments on commit 23abd90

Please sign in to comment.