@@ -390,19 +390,23 @@ impl EditorView {
390 // of times than it is to always call Rope::slice/get_slice (it will internally always hit RSEnum::Light).
390 // of times than it is to always call Rope::slice/get_slice (it will internally always hit RSEnum::Light).
391 let text = doc.text().slice(..);
391 let text = doc.text().slice(..);
393+ let characters = &whitespace.characters;
393 let mut spans = Vec::new();
395 let mut spans = Vec::new();
394 let mut visual_x = 0u16;
396 let mut visual_x = 0u16;
395 let mut line = 0u16;
397 let mut line = 0u16;
396 let tab_width = doc.tab_width();
398 let tab_width = doc.tab_width();
397 let tab = if whitespace.render.tab() == WhitespaceRenderValue::All {
399 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))
400 " ".repeat(tab_width)
404 " ".repeat(tab_width)
402− let space = whitespace.characters.space.to_string();
406+ let space = characters.space.to_string();
403− let nbsp = whitespace.characters.nbsp.to_string();
407+ let nbsp = characters.nbsp.to_string();
404 let newline = if whitespace.render.newline() == WhitespaceRenderValue::All {
408 let newline = if whitespace.render.newline() == WhitespaceRenderValue::All {
405− whitespace.characters.newline.to_string()
409+ characters.newline.to_string()
407 " ".to_string()
411 " ".to_string()