From 320b034f5b509723f0ba834d0d1a87c69661161a Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 10 Jun 2024 10:20:12 -0600 Subject: [PATCH] Performance improvement in set_tab_width --- src/buffer.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/buffer.rs b/src/buffer.rs index 714cd23..0a035a2 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -596,8 +596,10 @@ impl Buffer { self.tab_width = tab_width; // Shaping must be reset when tab width is changed for line in self.lines.iter_mut() { - if line.text().contains('\t') { - line.reset_shaping(); + if line.shape_opt().is_some() { + if line.text().contains('\t') { + line.reset_shaping(); + } } } self.redraw = true;