From 38a46a66822e87d7b36b9f7f8680bdd91468bb5e Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 22 Mar 2013 13:41:48 +0100 Subject: [PATCH] add WinDisplay hook --- README.asciidoc | 4 +++- src/context.hh | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.asciidoc b/README.asciidoc index f6cab390..6e2c1ced 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 05e5e59c..bfbc6c6d 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