Fix hidden placeholder appearing in empty editor
This commit is contained in:
parent
35aa70de4b
commit
810524325e
1 changed files with 4 additions and 1 deletions
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue