1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-24 03:56:32 +03:00

call compute_lines before hooks at Buffer construction

This commit is contained in:
Maxime Coste 2012-02-28 14:23:52 +00:00
parent bc3d20bf2a
commit c4ad372d91

View File

@ -27,13 +27,12 @@ Buffer::Buffer(const std::string& name, Type type,
m_content(initial_content), m_last_save_undo_index(0) m_content(initial_content), m_last_save_undo_index(0)
{ {
BufferManager::instance().register_buffer(this); BufferManager::instance().register_buffer(this);
compute_lines();
if (type == Type::NewFile) if (type == Type::NewFile)
GlobalHooksManager::instance().run_hook("BufCreate", name, Context(*this)); GlobalHooksManager::instance().run_hook("BufCreate", name, Context(*this));
else if (type == Type::File) else if (type == Type::File)
GlobalHooksManager::instance().run_hook("BufOpen", name, Context(*this)); GlobalHooksManager::instance().run_hook("BufOpen", name, Context(*this));
compute_lines();
} }
Buffer::~Buffer() Buffer::~Buffer()