Performance improvement in set_tab_width

This commit is contained in:
Jeremy Soller 2024-06-10 10:20:12 -06:00
parent 10ae9a9b16
commit 320b034f5b

View file

@ -596,10 +596,12 @@ impl Buffer {
self.tab_width = tab_width; self.tab_width = tab_width;
// Shaping must be reset when tab width is changed // Shaping must be reset when tab width is changed
for line in self.lines.iter_mut() { for line in self.lines.iter_mut() {
if line.shape_opt().is_some() {
if line.text().contains('\t') { if line.text().contains('\t') {
line.reset_shaping(); line.reset_shaping();
} }
} }
}
self.redraw = true; self.redraw = true;
self.shape_until_scroll(font_system, false); self.shape_until_scroll(font_system, false);
} }