From 2626ce858f7316a86c28d406161500234c71fc1f Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 7 Mar 2016 22:14:03 +0000 Subject: Move handling to normal mode from client Client handling prevents :exec from triggering a redraw --- src/normal.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/normal.cc') diff --git a/src/normal.cc b/src/normal.cc index 4d95ff53..d0850a92 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -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 }, @@ -1734,6 +1740,8 @@ static NormalCmdDesc cmds[] = { 'z', "restore selections", restore_selections }, { alt('z'), "append saved selections", restore_selections }, { 'Z', "save selections", save_selections }, + + { ctrl('l'), "force redraw", force_redraw }, }; KeyMap keymap = cmds; -- cgit v1.2.3 From 6c8f8fe691f33fbd19d477b7b94ac6d942113d86 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 7 Mar 2016 23:11:59 +0000 Subject: Rework client redrawing, delay menu/info methods until next refresh That avoid sending lots of spurious info_hide/menu_hide, just set a flag and wait until the client is asked to redraw. --- src/normal.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/normal.cc') diff --git a/src/normal.cc b/src/normal.cc index d0850a92..33c813f6 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -1563,7 +1563,10 @@ void ensure_forward(Context& context, NormalParams) void force_redraw(Context& context, NormalParams) { if (context.has_client()) - context.client().redraw_ifn(true); + { + context.client().force_redraw(); + context.client().redraw_ifn(); + } } static NormalCmdDesc cmds[] = -- cgit v1.2.3