Fix hidden placeholder appearing in empty editor

This commit is contained in:
Joscha 2023-04-13 02:18:32 +02:00
parent 35aa70de4b
commit 810524325e

View file

@ -417,7 +417,10 @@ impl Editor<'_> {
} }
fn rows(&self, indices: &[usize]) -> Vec<Styled> { fn rows(&self, indices: &[usize]) -> Vec<Styled> {
let text = self.hidden.as_ref().unwrap_or(&self.highlighted); let text = match self.hidden.as_ref() {
Some(hidden) if !self.highlighted.text().is_empty() => hidden,
_ => &self.highlighted,
};
text.clone().split_at_indices(indices) text.clone().split_at_indices(indices)
} }