Add justification buttons to editor-libcosmic

This commit is contained in:
Hojjat 2023-02-22 21:59:03 -07:00
parent 59e89bdbaa
commit 2442422762
5 changed files with 42 additions and 5 deletions

View file

@ -522,6 +522,20 @@ impl<'a> Buffer<'a> {
}
}
/// Get the current [`Align`]
pub fn align(&self) -> Align {
self.align
}
/// Set the current [`Wrap`]
pub fn set_align(&mut self, align: Align) {
if align != self.align {
self.align = align;
self.relayout();
self.shape_until_scroll();
}
}
/// Get the current buffer dimensions (width, height)
pub fn size(&self) -> (i32, i32) {
(self.width, self.height)