Support expanding tabs

This commit is contained in:
Jeremy Soller 2024-06-06 21:01:46 -06:00
parent 56812a8348
commit 3c94352f3f
9 changed files with 82 additions and 25 deletions

View file

@ -282,7 +282,7 @@ pub trait Edit<'buffer> {
fn tab_width(&self) -> u16;
/// Set the current tab width. A `tab_width` of 0 is not allowed, and will be ignored
fn set_tab_width(&mut self, tab_width: u16);
fn set_tab_width(&mut self, font_system: &mut FontSystem, tab_width: u16);
/// Shape lines until scroll, after adjusting scroll if the cursor moved
fn shape_as_needed(&mut self, font_system: &mut FontSystem, prune: bool);
@ -336,6 +336,11 @@ impl<'font_system, 'buffer, E: Edit<'buffer>> BorrowedWithFontSystem<'font_syste
})
}
/// Set the current tab width. A `tab_width` of 0 is not allowed, and will be ignored
pub fn set_tab_width(&mut self, tab_width: u16) {
self.inner.set_tab_width(self.font_system, tab_width);
}
/// Shape lines until scroll, after adjusting scroll if the cursor moved
pub fn shape_as_needed(&mut self, prune: bool) {
self.inner.shape_as_needed(self.font_system, prune);