diff options
author | Yatao Li <yatli@microsoft.com> | 2021-09-11 10:19:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-10 19:19:39 -0700 |
commit | 086631cd92d7b60f122963f9fd1779583b19004c (patch) | |
tree | d126146d64dcd4a15ea59d5cb1f4321a179fa96f /src | |
parent | 09a477737fbfec1d49a88709e9d4661a0b4fd1e8 (diff) | |
download | rneovim-086631cd92d7b60f122963f9fd1779583b19004c.tar.gz rneovim-086631cd92d7b60f122963f9fd1779583b19004c.tar.bz2 rneovim-086631cd92d7b60f122963f9fd1779583b19004c.zip |
feat(api): win_viewport also sends line_count #15613
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/api/ui_events.in.h | 3 | ||||
-rw-r--r-- | src/nvim/window.c | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/nvim/api/ui_events.in.h b/src/nvim/api/ui_events.in.h index 35d39a34d7..03fe5c5058 100644 --- a/src/nvim/api/ui_events.in.h +++ b/src/nvim/api/ui_events.in.h @@ -119,7 +119,8 @@ void msg_set_pos(Integer grid, Integer row, Boolean scrolled, String sep_char) FUNC_API_SINCE(6) FUNC_API_BRIDGE_IMPL FUNC_API_COMPOSITOR_IMPL; void win_viewport(Integer grid, Window win, Integer topline, - Integer botline, Integer curline, Integer curcol) + Integer botline, Integer curline, Integer curcol, + Integer line_count) FUNC_API_SINCE(7) FUNC_API_REMOTE_ONLY; void popupmenu_show(Array items, Integer selected, diff --git a/src/nvim/window.c b/src/nvim/window.c index cb4be36d36..42fe2c0f49 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -840,14 +840,15 @@ void ui_ext_win_viewport(win_T *wp) { if ((wp == curwin || ui_has(kUIMultigrid)) && wp->w_viewport_invalid) { int botline = wp->w_botline; - if (botline == wp->w_buffer->b_ml.ml_line_count+1 - && wp->w_empty_rows == 0) { + int line_count = wp->w_buffer->b_ml.ml_line_count; + if (botline == line_count+1 && wp->w_empty_rows == 0) { // TODO(bfredl): The might be more cases to consider, like how does this // interact with incomplete final line? Diff filler lines? botline = wp->w_buffer->b_ml.ml_line_count; } ui_call_win_viewport(wp->w_grid_alloc.handle, wp->handle, wp->w_topline-1, - botline, wp->w_cursor.lnum-1, wp->w_cursor.col); + botline, wp->w_cursor.lnum-1, wp->w_cursor.col, + line_count); wp->w_viewport_invalid = false; } } |