editor: Fix may crash on render indent guides. (#1619)
This commit is contained in:
parent
672a80dcd8
commit
0a5c799aba
1 changed files with 4 additions and 1 deletions
|
|
@ -124,7 +124,10 @@ impl TextElement {
|
|||
let mut last_indents = vec![];
|
||||
for ix in visible_range {
|
||||
let line = state.text.slice_line(ix);
|
||||
let line_layout = last_layout.line(ix).expect("line layout should exist");
|
||||
let Some(line_layout) = last_layout.line(ix) else {
|
||||
continue;
|
||||
};
|
||||
|
||||
let mut current_indents = vec![];
|
||||
if line.len() > 0 {
|
||||
let indent_count = tab_size.indent_count(&line);
|
||||
|
|
|
|||
Loading…
Reference in a new issue