aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui/document.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/ui/document.rs')
-rw-r--r--helix-term/src/ui/document.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/helix-term/src/ui/document.rs b/helix-term/src/ui/document.rs
index dc61ca2e..b571b83c 100644
--- a/helix-term/src/ui/document.rs
+++ b/helix-term/src/ui/document.rs
@@ -341,6 +341,7 @@ pub struct TextRenderer<'a> {
pub indent_guide_style: Style,
pub newline: String,
pub nbsp: String,
+ pub nnbsp: String,
pub space: String,
pub tab: String,
pub virtual_tab: String,
@@ -395,6 +396,11 @@ impl<'a> TextRenderer<'a> {
} else {
" ".to_owned()
};
+ let nnbsp = if ws_render.nnbsp() == WhitespaceRenderValue::All {
+ ws_chars.nnbsp.into()
+ } else {
+ " ".to_owned()
+ };
let text_style = theme.get("ui.text");
@@ -405,6 +411,7 @@ impl<'a> TextRenderer<'a> {
indent_guide_char: editor_config.indent_guides.character.into(),
newline,
nbsp,
+ nnbsp,
space,
tab,
virtual_tab,
@@ -448,6 +455,7 @@ impl<'a> TextRenderer<'a> {
let width = grapheme.width();
let space = if is_virtual { " " } else { &self.space };
let nbsp = if is_virtual { " " } else { &self.nbsp };
+ let nnbsp = if is_virtual { " " } else { &self.nnbsp };
let tab = if is_virtual {
&self.virtual_tab
} else {
@@ -461,6 +469,7 @@ impl<'a> TextRenderer<'a> {
// TODO special rendering for other whitespaces?
Grapheme::Other { ref g } if g == " " => space,
Grapheme::Other { ref g } if g == "\u{00A0}" => nbsp,
+ Grapheme::Other { ref g } if g == "\u{202F}" => nnbsp,
Grapheme::Other { ref g } => g,
Grapheme::Newline => &self.newline,
};