Skip to content

Commit

Permalink
add the convenient API for setting tab width
Browse files Browse the repository at this point in the history
  • Loading branch information
wildwestrom authored and jackpot51 committed Sep 1, 2024
1 parent e16b39f commit 7c25fcb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,11 @@ impl<'a> BorrowedWithFontSystem<'a, Buffer> {
.set_metrics_and_size(self.font_system, metrics, width_opt, height_opt);
}

/// Set tab width (number of spaces between tab stops)
pub fn set_tab_width(&mut self, tab_width: u16) {
self.inner.set_tab_width(self.font_system, tab_width);
}

/// Set text of buffer, using provided attributes for each line by default
pub fn set_text(&mut self, text: &str, attrs: Attrs, shaping: Shaping) {
self.inner.set_text(self.font_system, text, attrs, shaping);
Expand Down

0 comments on commit 7c25fcb

Please sign in to comment.