Skip to content

Commit b1a5dd2

Browse files
committed
Ensure display buffer is up-to-date before view commands
While not strictly necessary, the buffer timestamp stored inside the display buffer being out of date may lead to scrolling on next display update, this scrolling is undesirable after a view command, in order to disable it we need that timestamp to be updated and doing a full display buffer update is the simplest way to achieve that. Fixes #5364
1 parent 856da7e commit b1a5dd2

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

src/normal.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ void view_commands(Context& context, NormalParams params)
385385

386386
const BufferCoord cursor = context.selections().main().cursor();
387387
Window& window = context.window();
388+
window.update_display_buffer(context);
388389

389390
const DisplayCoord scrolloff = context.options()["scrolloff"].get<DisplayCoord>();
390391
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+
<c-l>:exec<space>ggi<lt>ret<gt><lt>esc<gt>/^c$<lt>ret<gt>vt<ret>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
a
2+
b
3+
c
4+
d
5+
e
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ui_out -until '{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }'
2+
ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "underline": "default", "attributes": [] }, "contents": "c" }, { "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "d\u000a" }], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "e\u000a" }]], { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "underline": "default", "attributes": [] }] }'

0 commit comments

Comments
 (0)