export entire TextView widget reference to the Search component

This commit is contained in:
yggverse 2024-12-17 02:13:47 +02:00
parent e0cb5d7a0f
commit 8b65df99f4
8 changed files with 52 additions and 43 deletions

View file

@ -1,25 +0,0 @@
mod tag;
use tag::Tag;
use gtk::{prelude::TextBufferExt, TextBuffer};
pub struct Buffer {
pub text_buffer: TextBuffer,
pub tag: Tag,
}
impl Buffer {
// Constructors
/// Create new `Self`
pub fn new(text_buffer: TextBuffer) -> 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_buffer.tag_table());
// Init `Self`
Self { text_buffer, tag }
}
}