summaryrefslogtreecommitdiff
path: root/helix-term/test.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2020-09-10 04:55:18 +0000
committerBlaž Hrastnik2020-09-10 09:19:59 +0000
commitb647c7a773fb3323ccc884f4d0d4ce25c3e8aea8 (patch)
tree3ad4ef86e92c2482b3dcf14aaca4bfb74038678e /helix-term/test.rs
parent25b3f98e3d200ae7f0f08b10be50552359502494 (diff)
tree-sitter based syntax highlighting draft
Diffstat (limited to 'helix-term/test.rs')
-rw-r--r--helix-term/test.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/helix-term/test.rs b/helix-term/test.rs
new file mode 100644
index 00000000..713c23d0
--- /dev/null
+++ b/helix-term/test.rs
@@ -0,0 +1,36 @@
+pub struct TextArea {
+ properties: Properties,
+ frame: Rect,
+}
+
+impl Component for TextArea {
+ type Message = ();
+ type Properties = Properties;
+
+ fn create(properties: Self::Properties, frame: Rect, _link: ComponentLink<Self>) -> Self {
+ TextArea { properties, frame }
+ }
+
+ fn change<'a>(&'a mut self, properties: Self::Properties) -> ShouldRender {
+ let a: &'static str = "ase";
+ let q = 2u8;
+ let q = 2 as u16;
+ Some(0);
+ true;
+ self.properties = properties;
+ ShouldRender::Yes
+ }
+
+ fn resize(&mut self, frame: Rect) -> ShouldRender {
+ println!("hello world! \" test");
+ self.frame = frame;
+ ShouldRender::Yes
+ }
+
+ fn view(&self) -> Layout {
+ let mut canvas = Canvas::new(self.frame.size);
+ canvas.clear(self.properties.theme.text);
+ self.draw_text(&mut canvas);
+ canvas.into()
+ }
+}