Decouple editing from buffer

This commit is contained in:
Jeremy Soller 2022-10-31 11:24:36 -06:00
parent 26c83be35a
commit 92cad6fe13
No known key found for this signature in database
GPG key ID: 87F211AF2BE4C2FE
11 changed files with 901 additions and 858 deletions

View file

@ -1,7 +1,7 @@
use crate::{AttrsList, FontSystem, LayoutLine, ShapeLine};
/// A line (or paragraph) of text that is shaped and laid out
pub struct TextBufferLine<'a> {
pub struct BufferLine<'a> {
//TODO: make this not pub(crate)
text: String,
attrs_list: AttrsList<'a>,
@ -10,7 +10,7 @@ pub struct TextBufferLine<'a> {
layout_opt: Option<Vec<LayoutLine>>,
}
impl<'a> TextBufferLine<'a> {
impl<'a> BufferLine<'a> {
/// Create a new line with the given text and attributes list
/// Cached shaping and layout can be done using the [Self::shape] and
/// [Self::layout] functions