aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaž Hrastnik2020-06-02 01:44:44 +0000
committerBlaž Hrastnik2020-06-02 01:44:44 +0000
commitc17045ed0750ff4ba8ea6f148992e4de611c5537 (patch)
tree92461255ba352c438a7f65f41c24d13ba4f0e530
parent2ea5feaeb15cefaaed66a759ec895298dbf479b4 (diff)
Fixup Surface
-rw-r--r--helix-term/src/component.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/helix-term/src/component.rs b/helix-term/src/component.rs
index 8ec5663a..08d6c620 100644
--- a/helix-term/src/component.rs
+++ b/helix-term/src/component.rs
@@ -1,15 +1,17 @@
-
// IDEA: render to a cache buffer, then if not changed, copy the buf into the parent
+type Surface = ();
pub trait Component {
/// Process input events, return true if handled.
- fn process_event(&mut self, event: crossterm::event::Event, args) -> bool;
+ fn process_event(&mut self, event: crossterm::event::Event, args: ()) -> bool;
/// Should redraw? Useful for saving redraw cycles if we know component didn't change.
- fn should_update(&self) -> bool { true }
+ fn should_update(&self) -> bool {
+ true
+ }
fn render(&mut self, surface: &mut Surface, args: ());
}
-// HStack / VStack
+// HStack / VStack
// focus by component id: each View/Editor gets it's own incremental id at create
// Component: View(Arc<State>) -> multiple views can point to same state
// id 0 = prompt?