I use cosmic-text editor (external crate) that I keep in component per entity here: https://github.com/StaffEngineer/velo/blob/85f75bd0859638d5f33c8ada1eab093618b51ae1/crates/bevy_cosmic_edit/src/lib.rs#L65
Now I want to extend it to keep SyntaxEditor (that is a wrapper of Editor): https://github.com/pop-os/cosmic-text/blob/bfb5eefbfa869915e47824877af68a5307cf301c/src/edit/syntect.rs#L32 and ViEditor (that is a wrapper of SyntaxEditor): https://github.com/pop-os/cosmic-text/blob/bfb5eefbfa869915e47824877af68a5307cf301c/src/edit/vi.rs#L19
The issue is SyntaxEditor and ViEditor has lifetimes, so is there a way to keep them on component... or is there any other better way to solve this issue? Any advice is welcome.
* I access editor in different systems through component
** Editor, SyntaxEditor, ViEditor are all implement Edit trait