aboutsummaryrefslogtreecommitdiff
path: root/helix-view
diff options
context:
space:
mode:
authorQuentin2024-03-25 01:29:36 +0000
committerGitHub2024-03-25 01:29:36 +0000
commit614a744d24e54225eae2ad0d27719b81c0cf9a4d (patch)
treed7d70ed5ffa7d883ddc6c9d2ac96ac5c8e4fa1dc /helix-view
parent2d9e336f640cccdd347e35289c3e4c0371777a3f (diff)
Add narrow no-break space support (#9604)
Diffstat (limited to 'helix-view')
-rw-r--r--helix-view/src/editor.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 3c530c4e..dd360a78 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -702,6 +702,7 @@ pub enum WhitespaceRender {
default: Option<WhitespaceRenderValue>,
space: Option<WhitespaceRenderValue>,
nbsp: Option<WhitespaceRenderValue>,
+ nnbsp: Option<WhitespaceRenderValue>,
tab: Option<WhitespaceRenderValue>,
newline: Option<WhitespaceRenderValue>,
},
@@ -733,6 +734,14 @@ impl WhitespaceRender {
}
}
}
+ pub fn nnbsp(&self) -> WhitespaceRenderValue {
+ match *self {
+ Self::Basic(val) => val,
+ Self::Specific { default, nnbsp, .. } => {
+ nnbsp.or(default).unwrap_or(WhitespaceRenderValue::None)
+ }
+ }
+ }
pub fn tab(&self) -> WhitespaceRenderValue {
match *self {
Self::Basic(val) => val,
@@ -756,6 +765,7 @@ impl WhitespaceRender {
pub struct WhitespaceCharacters {
pub space: char,
pub nbsp: char,
+ pub nnbsp: char,
pub tab: char,
pub tabpad: char,
pub newline: char,
@@ -766,6 +776,7 @@ impl Default for WhitespaceCharacters {
Self {
space: '·', // U+00B7
nbsp: '⍽', // U+237D
+ nnbsp: '␣', // U+2423
tab: '→', // U+2192
newline: '⏎', // U+23CE
tabpad: ' ',