Allow context with client and non-window editor
This commit is contained in:
parent
7cc5ff7c73
commit
1515566e4b
|
@ -683,7 +683,7 @@ void exec_keys(const KeyList& keys, Context& context)
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
Context new_context(batch_client);
|
Context new_context(batch_client);
|
||||||
new_context.change_editor(context.window());
|
new_context.change_editor(context.editor());
|
||||||
while (batch_client.has_key_left())
|
while (batch_client.has_key_left())
|
||||||
{
|
{
|
||||||
Key key = batch_client.get_key();
|
Key key = batch_client.get_key();
|
||||||
|
|
|
@ -56,8 +56,6 @@ struct Context
|
||||||
|
|
||||||
void change_editor(Editor& editor)
|
void change_editor(Editor& editor)
|
||||||
{
|
{
|
||||||
if (has_client() and not dynamic_cast<Window*>(&editor))
|
|
||||||
throw logic_error();
|
|
||||||
m_editor.reset(&editor);
|
m_editor.reset(&editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +70,7 @@ struct Context
|
||||||
|
|
||||||
void draw_ifn() const
|
void draw_ifn() const
|
||||||
{
|
{
|
||||||
if (has_client())
|
if (has_client() and has_window())
|
||||||
client().draw_window(window());
|
client().draw_window(window());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user