File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ pub trait EntityTrait {
1111 fn render ( & self , rc : & mut RenderContext ) ;
1212}
1313
14- #[ derive( knus:: Decode , Debug ) ]
14+ #[ derive( knus:: Decode , Debug , Clone ) ]
1515pub struct Text {
1616 #[ knus( argument, default = nanoid!( ) ) ]
1717 id : String ,
@@ -68,7 +68,7 @@ impl EntityTrait for Text {
6868 }
6969}
7070
71- #[ derive( knus:: Decode ) ]
71+ #[ derive( knus:: Decode , Clone ) ]
7272#[ enum_dispatch( EntityTrait ) ]
7373pub enum Entity {
7474 Text ( Text ) ,
Original file line number Diff line number Diff line change 11use egui:: Margin ;
22
3- use crate :: stage:: { Stage , structs:: Entity } ;
3+ use crate :: stage:: {
4+ Stage ,
5+ structs:: { Entity , EntityTrait } ,
6+ } ;
47
58pub struct Terminal {
69 input : String ,
@@ -78,7 +81,9 @@ impl Terminal {
7881 match knus:: parse :: < Vec < Entity > > ( "terminal_input.kdl" , & self . input ) {
7982 Ok ( doc) => {
8083 for entity in doc {
81- stage. context . add ( entity. into ( ) ) ;
84+ stage. context . add ( entity. clone ( ) ) ;
85+ self . history
86+ . push ( HistoryItem :: Out ( entity. id ( ) . to_string ( ) ) ) ;
8287 }
8388 }
8489 Err ( e) => {
You can’t perform that action at this time.
0 commit comments