Fix editor panicking sometimes when hidden
This commit is contained in:
parent
8bfb4b2dc3
commit
f005ec10fe
1 changed files with 2 additions and 1 deletions
|
|
@ -412,7 +412,8 @@ impl Editor<'_> {
|
||||||
// One extra column for cursor
|
// One extra column for cursor
|
||||||
.map(|w| w.saturating_sub(1) as usize)
|
.map(|w| w.saturating_sub(1) as usize)
|
||||||
.unwrap_or(usize::MAX);
|
.unwrap_or(usize::MAX);
|
||||||
wrap(widthdb, self.state.text(), max_width)
|
let text = self.hidden.as_ref().unwrap_or(&self.highlighted);
|
||||||
|
wrap(widthdb, text.text(), max_width)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn rows(&self, indices: &[usize]) -> Vec<Styled> {
|
fn rows(&self, indices: &[usize]) -> Vec<Styled> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue