@@ -390,19 +390,23 @@ impl EditorView {
390390 // of times than it is to always call Rope::slice/get_slice (it will internally always hit RSEnum::Light).
391391 let text = doc.text().slice(..);
392392
393+ let characters = &whitespace.characters;
394+
393395 let mut spans = Vec::new();
394396 let mut visual_x = 0u16;
395397 let mut line = 0u16;
396398 let tab_width = doc.tab_width();
397399 let tab = if whitespace.render.tab() == WhitespaceRenderValue::All {
398− (1..tab_width).fold(whitespace.characters.tab.to_string(), |s, _| s + " ")
400+ std::iter::once(characters.tab)
401+ .chain(std::iter::repeat(characters.tabpad).take(tab_width - 1))
402+ .collect()
399403 } else {
400404 " ".repeat(tab_width)
401405 };
402− let space = whitespace.characters.space.to_string();
403− let nbsp = whitespace.characters.nbsp.to_string();
406+ let space = characters.space.to_string();
407+ let nbsp = characters.nbsp.to_string();
404408 let newline = if whitespace.render.newline() == WhitespaceRenderValue::All {
405− whitespace.characters.newline.to_string()
409+ characters.newline.to_string()
406410 } else {
407411 " ".to_string()
408412 };