add WinDisplay hook

This commit is contained in:
Maxime Coste 2013-03-22 13:41:48 +01:00
parent 60599917cc
commit 38a46a6682
2 changed files with 9 additions and 3 deletions

View File

@ -361,7 +361,9 @@ existing hooks are:
* +InsertKey+: A key is received in insert mode, the key is used for filtering * +InsertKey+: A key is received in insert mode, the key is used for filtering
* +InsertMove+: The cursor moved (without inserting) in insert mode, the key * +InsertMove+: The cursor moved (without inserting) in insert mode, the key
that triggered the move is used for filtering that triggered the move is used for filtering
* +WinCreate+: A window was created * +WinCreate+: A window was created, the filtering text is the buffer name
* +WinDisplay+: A window was bound a client, the filtering text is the buffer
name
* +WinSetOption+: An option was set in a window context, the filtering text * +WinSetOption+: An option was set in a window context, the filtering text
is '<option_name>=<new_value>' is '<option_name>=<new_value>'
* +BufNew+: A buffer for a new file has been created, filename is used for * +BufNew+: A buffer for a new file has been created, filename is used for

View File

@ -69,8 +69,12 @@ struct Context
void change_editor(Editor& editor) void change_editor(Editor& editor)
{ {
m_editor.reset(&editor); m_editor.reset(&editor);
if (has_window() && has_ui()) if (has_window())
window().set_dimensions(ui().dimensions()); {
if (has_ui())
window().set_dimensions(ui().dimensions());
window().hooks().run_hook("WinDisplay", buffer().name(), *this);
}
} }
OptionManager& options() const OptionManager& options() const