Allow context with client and non-window editor

This commit is contained in:
Maxime Coste 2012-08-17 20:18:36 +02:00
parent 7cc5ff7c73
commit 1515566e4b
2 changed files with 2 additions and 4 deletions

View File

@ -683,7 +683,7 @@ void exec_keys(const KeyList& keys, Context& context)
int count = 0;
Context new_context(batch_client);
new_context.change_editor(context.window());
new_context.change_editor(context.editor());
while (batch_client.has_key_left())
{
Key key = batch_client.get_key();

View File

@ -56,8 +56,6 @@ struct Context
void change_editor(Editor& editor)
{
if (has_client() and not dynamic_cast<Window*>(&editor))
throw logic_error();
m_editor.reset(&editor);
}
@ -72,7 +70,7 @@ struct Context
void draw_ifn() const
{
if (has_client())
if (has_client() and has_window())
client().draw_window(window());
}