Always ensure we do not scroll past the last line
An assert fails from time to time after reloading fifo buffers due to being scrolled past the last line of the buffer. A repro case was not found but this should fix the underlying issue.
This commit is contained in:
parent
2fa55be40a
commit
8cc4de5bb3
|
@ -209,8 +209,9 @@ DisplaySetup Window::compute_display_setup(const Context& context) const
|
||||||
if (cursor.line - offset.line < win_pos.line)
|
if (cursor.line - offset.line < win_pos.line)
|
||||||
win_pos.line = std::max(0_line, cursor.line - offset.line);
|
win_pos.line = std::max(0_line, cursor.line - offset.line);
|
||||||
if (cursor.line + offset.line >= win_pos.line + m_dimensions.line)
|
if (cursor.line + offset.line >= win_pos.line + m_dimensions.line)
|
||||||
win_pos.line = std::min(buffer().line_count()-1, cursor.line + offset.line - m_dimensions.line + 1);
|
win_pos.line = cursor.line + offset.line - m_dimensions.line + 1;
|
||||||
}
|
}
|
||||||
|
win_pos.line = std::min(win_pos.line, buffer().line_count()-1);
|
||||||
|
|
||||||
DisplaySetup setup{
|
DisplaySetup setup{
|
||||||
win_pos.line,
|
win_pos.line,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user