comparison src/testdir/test_bufwintabinfo.vim @ 28546:65ff2409cba4 v8.2.4797

patch 8.2.4797: getwininfo() may get oudated values Commit: https://github.com/vim/vim/commit/8530b41fd3872c9a1349b083470d565677948518 Author: LemonBoy <thatlemon@gmail.com> Date: Wed Apr 20 19:00:36 2022 +0100 patch 8.2.4797: getwininfo() may get oudated values Problem: getwininfo() may get oudated values. Solution: Make sure w_botline is up-to-date. (closes https://github.com/vim/vim/issues/10226)
author Bram Moolenaar <Bram@vim.org>
date Wed, 20 Apr 2022 20:15:03 +0200
parents 72c394673e00
children
comparison
equal deleted inserted replaced
28545:d89bd590e2b3 28546:65ff2409cba4
170 call assert_equal(3, getbufinfo(bn)[0]["linecount"]) 170 call assert_equal(3, getbufinfo(bn)[0]["linecount"])
171 edit Xfoo 171 edit Xfoo
172 bw! 172 bw!
173 endfunc 173 endfunc
174 174
175 func Test_getwininfo_au()
176 enew
177 call setline(1, range(1, 16))
178
179 let g:info = #{}
180 augroup T1
181 au!
182 au WinEnter * let g:info = getwininfo(win_getid())[0]
183 augroup END
184
185 4split
186 " Check that calling getwininfo() from WinEnter returns fresh values for
187 " topline and botline.
188 call assert_equal(1, g:info.topline)
189 call assert_equal(4, g:info.botline)
190 close
191
192 unlet g:info
193 augroup! T1
194 bwipe!
195 endfunc
196
175 " vim: shiftwidth=2 sts=2 expandtab 197 " vim: shiftwidth=2 sts=2 expandtab