mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
28 lines
549 B
Rust
28 lines
549 B
Rust
mod tag;
|
|
|
|
use tag::Tag;
|
|
|
|
use gtk::{
|
|
TextView,
|
|
prelude::{TextBufferExt, TextViewExt},
|
|
};
|
|
|
|
pub struct Subject {
|
|
pub text_view: TextView,
|
|
pub tag: Tag,
|
|
}
|
|
|
|
impl Subject {
|
|
// Constructors
|
|
|
|
/// Create new `Self`
|
|
pub fn new(text_view: TextView) -> Self {
|
|
// Init components
|
|
// * create new tag objects required for new buffer,
|
|
// instead of re-use existing refs (maybe the bug)
|
|
let tag = Tag::new(text_view.buffer().tag_table());
|
|
|
|
// Init `Self`
|
|
Self { text_view, tag }
|
|
}
|
|
}
|