Buffer: keep track of eol_at_eof flag from TextLoader

This commit is contained in:
Josh Holtrop 2016-07-24 12:27:15 -04:00
parent 7093560a94
commit 0780659c8c
2 changed files with 5 additions and 1 deletions

View File

@ -6,9 +6,10 @@
Buffer::Buffer()
{
piece_table = std::make_shared<PieceTable>(nullptr, 0u);
m_file_buffer = nullptr;
m_file_buffer_size = 0u;
piece_table = std::make_shared<PieceTable>(nullptr, 0u);
m_eol_at_eof = true;
}
Buffer::~Buffer()
@ -56,6 +57,8 @@ bool Buffer::load_from_file(const char * filename)
piece_table->append_initial_line_piece(it->first, it->second, it->second);
}
m_eol_at_eof = text_loader.get_eol_at_eof();
return true;
}

View File

@ -17,6 +17,7 @@ public:
protected:
uint8_t * m_file_buffer;
unsigned long m_file_buffer_size;
bool m_eol_at_eof;
void free_file_buffer();
};