From 7c25fcb7aec026f1fbaae854cde3c164b015b1bd Mon Sep 17 00:00:00 2001 From: Christian Westrom Date: Sun, 1 Sep 2024 15:45:49 +0900 Subject: [PATCH] add the convenient API for setting tab width --- src/buffer.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/buffer.rs b/src/buffer.rs index a8f7d22..94055f7 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -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);