Fix infinite loop if scroll is on invalid line
This commit is contained in:
parent
93a7df859a
commit
69d5aec7fc
1 changed files with 4 additions and 0 deletions
|
|
@ -419,6 +419,10 @@ impl Buffer {
|
||||||
}
|
}
|
||||||
self.scroll.line = line_i;
|
self.scroll.line = line_i;
|
||||||
self.scroll.vertical += layout_height;
|
self.scroll.vertical += layout_height;
|
||||||
|
} else {
|
||||||
|
// If layout is missing, just assume line height
|
||||||
|
self.scroll.line = line_i;
|
||||||
|
self.scroll.vertical += metrics.line_height;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
self.scroll.vertical = 0.0;
|
self.scroll.vertical = 0.0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue