1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-30 23:37:17 +03:00

fix buffer creation on empty file

This commit is contained in:
Maxime Coste 2012-11-27 13:39:35 +01:00
parent 557128b641
commit f1b15ef86b

View File

@ -22,6 +22,9 @@ Buffer::Buffer(String name, Flags flags, std::vector<String> lines)
{
BufferManager::instance().register_buffer(*this);
if (lines.empty())
lines.emplace_back("\n");
ByteCount pos = 0;
m_lines.reserve(lines.size());
for (auto& line : lines)