on master help sign in
Fixup Surface
commitc17045ed0750ff4ba8ea6f148992e4de611c5537 authorBlaž Hrastnik <blaz@mxxn.io> dateTue 2 Jun 2020, 10:44 (6 years ago) parent2ea5fea
1 file changed+6−4
helix-term/src/component.rs+6−4
helix-term/src/component.rs+6−4
@@ -1,15 +1,17 @@
1−
21// IDEA: render to a cache buffer, then if not changed, copy the buf into the parent
2+type Surface = ();
33pub trait Component {
44 /// Process input events, return true if handled.
5− fn process_event(&mut self, event: crossterm::event::Event, args) -> bool;
5+ fn process_event(&mut self, event: crossterm::event::Event, args: ()) -> bool;
66 /// Should redraw? Useful for saving redraw cycles if we know component didn't change.
7− fn should_update(&self) -> bool { true }
7+ fn should_update(&self) -> bool {
8+ true
9+ }
810
911 fn render(&mut self, surface: &mut Surface, args: ());
1012}
1113
12−// HStack / VStack
14+// HStack / VStack
1315// focus by component id: each View/Editor gets it's own incremental id at create
1416// Component: View(Arc<State>) -> multiple views can point to same state
1517// id 0 = prompt?