Skip to content

Commit

Permalink
Revert "configure trailing cursor character"
Browse files Browse the repository at this point in the history
This reverts commit a03b2ee.
  • Loading branch information
the-mikedavis committed Mar 13, 2022
1 parent a03b2ee commit b6332a7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
9 changes: 1 addition & 8 deletions helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,14 +359,7 @@ impl EditorView {
// `unwrap_or_else` part is for off-the-end indices of
// the rope, to allow cursor highlighting at the end
// of the rope.
let text = text.get_slice(start..end).unwrap_or_else(|| {
if whitespace.render.eof() == WhitespaceRenderValue::All {
let eof: &str = whitespace.substitutions.eof.as_ref();
eof.into()
} else {
" ".into()
}
});
let text = text.get_slice(start..end).unwrap_or_else(|| " ".into());

use helix_core::graphemes::{grapheme_width, RopeGraphemes};

Expand Down
13 changes: 0 additions & 13 deletions helix-view/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ pub enum WhitespaceRender {
space: Option<WhitespaceRenderValue>,
tab: Option<WhitespaceRenderValue>,
newline: Option<WhitespaceRenderValue>,
eof: Option<WhitespaceRenderValue>,
},
}

Expand Down Expand Up @@ -276,15 +275,6 @@ impl WhitespaceRender {
} => newline.or(default).unwrap_or(WhitespaceRenderValue::None),
}
}

pub fn eof(&self) -> WhitespaceRenderValue {
match *self {
Self::Basic(val) => val,
Self::Specific { default, eof, .. } => {
eof.or(default).unwrap_or(WhitespaceRenderValue::None)
}
}
}
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
Expand All @@ -296,8 +286,6 @@ pub struct WhitespaceSubstitutions {
pub tab: String,
#[serde(deserialize_with = "deserialize_single_grapheme")]
pub newline: String,
#[serde(deserialize_with = "deserialize_single_grapheme")]
pub eof: String,
}

fn deserialize_single_grapheme<'de, D>(deserializer: D) -> Result<String, D::Error>
Expand All @@ -321,7 +309,6 @@ impl Default for WhitespaceSubstitutions {
space: "·".to_string(),
tab: "→".to_string(),
newline: "⏎".to_string(),
eof: "⠀".to_string(), // U+2800
}
}
}
Expand Down

0 comments on commit b6332a7

Please sign in to comment.