aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/multigrid_spec.lua
diff options
context:
space:
mode:
authorfredizzimo <fsundvik@gmail.com>2023-07-05 16:31:34 +0300
committerGitHub <noreply@github.com>2023-07-05 06:31:34 -0700
commit1de82e16c1216e1dbe22cf7a8ec9ea9e9e69b631 (patch)
treecbc63432ce20df6f0929566b1e102866add66c85 /test/functional/ui/multigrid_spec.lua
parent8a788e2daa5c62201f2bb278522eddd42f315d41 (diff)
downloadrneovim-1de82e16c1216e1dbe22cf7a8ec9ea9e9e69b631.tar.gz
rneovim-1de82e16c1216e1dbe22cf7a8ec9ea9e9e69b631.tar.bz2
rneovim-1de82e16c1216e1dbe22cf7a8ec9ea9e9e69b631.zip
fix(ui): delay win_viewport until screen update #24182
Problem: Sometimes, when nvim sends the `win_viewport` event, for example when scrolling with visible folds on the screen, it reports the `scroll_delta` value one batch into "future". So when the client application is trying to show the new viewport it's not yet updated, resulting in temporary corruption / screen flickering. For more details see #23609, and starting from [this comment]( https://github.com/neovide/neovide/pull/1790#issuecomment-1518697747) in https://github.com/neovide/neovide/pull/1790,, where the issue was first detected. Note that some of the conclusions in those are not fully accurate, but the general observations are. Solution: When there are pending updates to a Window, delay the `win_viewport` UI event until the updates are sent. This ensures that there's no flush between sending the viewport and updating of the lines corresponding to the new viewport. Document the existing viewport behaviour (for cases where there are no extra flushes), give a hint about how applications can deal with the slightly surprising behaviour of the viewport event being sent after the updates. Fixes https://github.com/neovim/neovim/issues/23609
Diffstat (limited to 'test/functional/ui/multigrid_spec.lua')
-rw-r--r--test/functional/ui/multigrid_spec.lua1
1 files changed, 0 insertions, 1 deletions
diff --git a/test/functional/ui/multigrid_spec.lua b/test/functional/ui/multigrid_spec.lua
index 2e66068037..1778c8218b 100644
--- a/test/functional/ui/multigrid_spec.lua
+++ b/test/functional/ui/multigrid_spec.lua
@@ -3808,7 +3808,6 @@ describe('ext_multigrid', function()
]], win_viewport={
[2] = {win = {id = 1000}, topline = 30586, botline = 30592, curline = 30591, curcol = 0, linecount = 30592, sum_scroll_delta = 30588};
}}
- command('autocmd CursorMoved * ++once call line("w$")') -- FIXME: this should not be needed
feed('gg')
screen:expect{grid=[[
## grid 1