Add BufReload hook which is triggered on buffer reload

This commit is contained in:
Christopher Fredén 2018-06-12 18:31:23 +02:00
parent f6d3501802
commit ae6c214f52
No known key found for this signature in database
GPG Key ID: BD62C269074D1B57
2 changed files with 3 additions and 1 deletions

View File

@ -283,6 +283,8 @@ void Client::reload_buffer()
reload_file_buffer(buffer); reload_file_buffer(buffer);
context().print_status({ format("'{}' reloaded", buffer.display_name()), context().print_status({ format("'{}' reloaded", buffer.display_name()),
context().faces()["Information"] }); context().faces()["Information"] });
m_window->hooks().run_hook("BufReload", buffer.name(), context());
} }
catch (runtime_error& error) catch (runtime_error& error)
{ {

View File

@ -801,7 +801,7 @@ const CommandDesc remove_highlighter_cmd = {
}; };
static constexpr auto hooks = { static constexpr auto hooks = {
"BufCreate", "BufNewFile", "BufOpenFile", "BufClose", "BufWritePost", "BufCreate", "BufNewFile", "BufOpenFile", "BufClose", "BufWritePost", "BufReload",
"BufWritePre", "BufOpenFifo", "BufCloseFifo", "BufReadFifo", "BufSetOption", "BufWritePre", "BufOpenFifo", "BufCloseFifo", "BufReadFifo", "BufSetOption",
"InsertBegin", "InsertChar", "InsertDelete", "InsertEnd", "InsertIdle", "InsertKey", "InsertBegin", "InsertChar", "InsertDelete", "InsertEnd", "InsertIdle", "InsertKey",
"InsertMove", "InsertCompletionHide", "InsertCompletionShow", "InsertCompletionSelect", "InsertMove", "InsertCompletionHide", "InsertCompletionShow", "InsertCompletionSelect",