Skip to content

Commit 64e4575

Browse files
committed
Ensure client redraws after view commands
b1a5dd2 introduced an update_display_buffer call prior to view commands to ensure view commands work off up to date display information, unfortunately, this breaks client display update as the window is likely to return false when its needs_redraw method gets called, which will prevent the next client redraw from happening. Force client to redraw explicitely after update_display_buffer, this probably should move to some helper function eventually as we really need to do both those whenever forcing an update_display_buffer Fixes #5383
1 parent b18e88c commit 64e4575

File tree

5 files changed

+42
-0
lines changed

5 files changed

+42
-0
lines changed

src/normal.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,8 @@ void view_commands(Context& context, NormalParams params)
410410
const BufferCoord cursor = context.selections().main().cursor();
411411
Window& window = context.window();
412412
window.update_display_buffer(context);
413+
if (context.has_client())
414+
context.client().force_redraw(false);
413415

414416
const DisplayCoord scrolloff = context.options()["scrolloff"].get<DisplayCoord>();
415417
const LineCount line_offset{std::min((window.dimensions().line - 1) / 2, scrolloff.line)};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ge
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
1
2+
2
3+
3
4+
4
5+
5
6+
6
7+
7
8+
8
9+
9
10+
10
11+
11
12+
12
13+
13
14+
14
15+
15
16+
16
17+
17
18+
18
19+
19
20+
20
21+
21
22+
22
23+
23
24+
24
25+
25
26+
26
27+
27
28+
28
29+
29
30+
30
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
map global normal = Gtvv
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ui_out '{ "jsonrpc": "2.0", "method": "set_ui_options", "params": [{}] }'
2+
ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "7\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "8\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "9\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "10\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "11\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "12\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "13\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "14\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "15\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "16\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "17\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "18\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "19\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "20\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "21\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "22\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "23\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "24\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "25\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "26\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "27\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "28\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "29\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "30" }, { "face": { "fg": "black", "bg": "cyan", "underline": "default", "attributes": [] }, "contents": "\u000a" }]], { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "underline": "default", "attributes": [] }] }'
3+
ui_out -until-grep 'refresh'
4+
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": ["="]}'
5+
ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "1\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "2\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "3\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "4\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "5\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "6\u000a" }], [{ "face": { "fg": "black", "bg": "white", "underline": "default", "attributes": [] }, "contents": "7" }, { "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "8\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "9\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "10\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "11\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "12\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "13\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "14\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "15\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "16\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "17\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "18\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "19\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "20\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "21\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "22\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "23\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "24\u000a" }]], { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "underline": "default", "attributes": [] }] }'
6+
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": ["="]}'
7+
ui_out -until-grep 'refresh'
8+
ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "underline": "default", "attributes": [] }, "contents": "1" }, { "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "2\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "3\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "4\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "5\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "6\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "7\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "8\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "9\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "10\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "11\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "12\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "13\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "14\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "15\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "16\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "17\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "18\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "19\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "20\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "21\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "22\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "23\u000a" }], [{ "face": { "fg": "white", "bg": "blue", "underline": "default", "attributes": [] }, "contents": "24\u000a" }]], { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "underline": "default", "attributes": [] }] }'

0 commit comments

Comments
 (0)