diff options
Diffstat (limited to 'helix-view/src')
-rw-r--r-- | helix-view/src/editor.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 38826f4b..0de1732c 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -288,6 +288,7 @@ pub enum WhitespaceRender { Specific { default: Option<WhitespaceRenderValue>, space: Option<WhitespaceRenderValue>, + nbsp: Option<WhitespaceRenderValue>, tab: Option<WhitespaceRenderValue>, newline: Option<WhitespaceRenderValue>, }, @@ -311,6 +312,14 @@ impl WhitespaceRender { } } } + pub fn nbsp(&self) -> WhitespaceRenderValue { + match *self { + Self::Basic(val) => val, + Self::Specific { default, nbsp, .. } => { + nbsp.or(default).unwrap_or(WhitespaceRenderValue::None) + } + } + } pub fn tab(&self) -> WhitespaceRenderValue { match *self { Self::Basic(val) => val, @@ -333,6 +342,7 @@ impl WhitespaceRender { #[serde(default)] pub struct WhitespaceCharacters { pub space: char, + pub nbsp: char, pub tab: char, pub newline: char, } @@ -341,6 +351,7 @@ impl Default for WhitespaceCharacters { fn default() -> Self { Self { space: '·', // U+00B7 + nbsp: '⍽', // U+237D tab: '→', // U+2192 newline: '⏎', // U+23CE } |