diff --git a/README.asciidoc b/README.asciidoc index f6cab3901..6e2c1ced8 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -361,7 +361,9 @@ existing hooks are: * +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 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 is '=' * +BufNew+: A buffer for a new file has been created, filename is used for diff --git a/src/context.hh b/src/context.hh index 05e5e59cc..bfbc6c6d7 100644 --- a/src/context.hh +++ b/src/context.hh @@ -69,8 +69,12 @@ struct Context void change_editor(Editor& editor) { m_editor.reset(&editor); - if (has_window() && has_ui()) - window().set_dimensions(ui().dimensions()); + if (has_window()) + { + if (has_ui()) + window().set_dimensions(ui().dimensions()); + window().hooks().run_hook("WinDisplay", buffer().name(), *this); + } } OptionManager& options() const