mirror of
https://github.com/mawww/kakoune.git
synced 2024-11-28 09:07:19 +03:00
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)
|
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;
|
auto target_line = target.lines.begin() + (size_t)pos.line;
|
||||||
for (auto& line : lines)
|
for (auto& line : lines)
|
||||||
{
|
{
|
||||||
@ -153,7 +153,8 @@ void TerminalUI::Window::blit(Window& target)
|
|||||||
target_line->resize(target.size.column);
|
target_line->resize(target.size.column);
|
||||||
target_line->atoms.insert(target_line->erase_range(pos.column, size.column),
|
target_line->atoms.insert(target_line->erase_range(pos.column, size.column),
|
||||||
line.atoms.begin(), line.atoms.end());
|
line.atoms.begin(), line.atoms.end());
|
||||||
++target_line;
|
if (++target_line == target.lines.end())
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user