mirror of
https://github.com/RGBCube/serenity
synced 2025-10-17 22:02:25 +00:00
Coalesce the current line into a single chunk when moving away from it.
This commit is contained in:
parent
e02eca2a5e
commit
efd5aae217
4 changed files with 20 additions and 0 deletions
|
@ -94,3 +94,13 @@ std::tuple<size_t, size_t> Line::chunk_index_for_position(size_t position)
|
|||
ASSERT(false);
|
||||
return std::make_tuple(0, 0);
|
||||
}
|
||||
|
||||
void Line::coalesce()
|
||||
{
|
||||
if (m_chunks.size() <= 1)
|
||||
return;
|
||||
|
||||
auto contents = data();
|
||||
m_chunks.clear();
|
||||
m_chunks.push_back(Chunk{ contents });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue