Move <c-l> handling to normal mode from client

Client handling prevents :exec from triggering a redraw
This commit is contained in:
Maxime Coste 2016-03-07 22:14:03 +00:00
parent 4d4f18a78a
commit 2626ce858f
2 changed files with 8 additions and 2 deletions

View File

@ -77,8 +77,6 @@ void Client::handle_available_input(EventMode mode)
{
if (*key == ctrl('c'))
killpg(getpgrp(), SIGINT);
if (*key == ctrl('l'))
redraw_ifn(true);
else if (*key == Key::FocusIn)
context().hooks().run_hook("FocusIn", context().name(), context());
else if (*key == Key::FocusOut)

View File

@ -1560,6 +1560,12 @@ void ensure_forward(Context& context, NormalParams)
context.selections().check_invariant();
}
void force_redraw(Context& context, NormalParams)
{
if (context.has_client())
context.client().redraw_ifn(true);
}
static NormalCmdDesc cmds[] =
{
{ 'h', "move left", move<CharCount, Backward> },
@ -1734,6 +1740,8 @@ static NormalCmdDesc cmds[] =
{ 'z', "restore selections", restore_selections<false> },
{ alt('z'), "append saved selections", restore_selections<true> },
{ 'Z', "save selections", save_selections },
{ ctrl('l'), "force redraw", force_redraw },
};
KeyMap keymap = cmds;