tweaks + docs
This commit is contained in:
1 parent
85f1ce125b
commit
2579baaa48
2 files changed
+7
-4
No files matched your search
@@ -31,6 +31,9 @@ use self::{
|
||||
pane_layout::PaneLayout,
|
||||
};
|
||||
|
||||
/// An `Input` is any event that can effect the editor state. This will most often be things like
|
||||
/// keystrokes and mouse clicks, but could in principle be something like a network packet
|
||||
/// arriving.
|
||||
#[derive(Clone, Debug)]
|
||||
pub(crate) enum Input {
|
||||
Character(char),
|
||||
|
||||
+4
-4
@@ -129,20 +129,20 @@ impl TerminalUI {
|
||||
|
||||
async fn run(&mut self) -> Result<()> {
|
||||
info!("Starting to run tui");
|
||||
|
||||
|
||||
'outer: loop {
|
||||
let evt = self.event_handler.next().await.unwrap();
|
||||
match evt {
|
||||
Event::Render => {
|
||||
// Process any pending commands
|
||||
self.editor_core.process_commands();
|
||||
|
||||
|
||||
// Render the current state
|
||||
self.terminal.draw(|mut frame| {
|
||||
self.terminal_state
|
||||
.render(&mut frame, &mut self.editor_core)
|
||||
})?;
|
||||
|
||||
|
||||
if self.editor_core.should_quit {
|
||||
break 'outer;
|
||||
}
|
||||
@@ -160,7 +160,7 @@ impl TerminalUI {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user