Tolerate bliting window that overflow the target
Although we try to avoid those, ensuring it never happens is tricky, and tolerating them avoids the crash. Fixes #3498
This commit is contained in:
parent
89e0b4b830
commit
cd613da050
|
@ -145,7 +145,7 @@ struct TerminalUI::Window::Line
|
|||
|
||||
void TerminalUI::Window::blit(Window& target)
|
||||
{
|
||||
kak_assert(pos.line + lines.size() <= target.lines.size());
|
||||
kak_assert(pos.line < target.lines.size());
|
||||
auto target_line = target.lines.begin() + (size_t)pos.line;
|
||||
for (auto& line : lines)
|
||||
{
|
||||
|
@ -153,7 +153,8 @@ void TerminalUI::Window::blit(Window& target)
|
|||
target_line->resize(target.size.column);
|
||||
target_line->atoms.insert(target_line->erase_range(pos.column, size.column),
|
||||
line.atoms.begin(), line.atoms.end());
|
||||
++target_line;
|
||||
if (++target_line == target.lines.end())
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user