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)