Patch 8.2.4797
Problem:    getwininfo() may get oudated values.
Solution:   Make sure w_botline is up-to-date. (closes #10226)
Files:      src/evalwindow.c, src/testdir/test_bufwintabinfo.vim


*** ../vim-8.2.4796/src/evalwindow.c    2022-04-18 18:31:57.110494523 +0100
--- src/evalwindow.c    2022-04-20 18:52:38.369486195 +0100
***************
*** 395,400 ****
--- 395,403 ----
      if (dict == NULL)
        return NULL;
  
+     // make sure w_botline is valid
+     validate_botline_win(wp);
+ 
      dict_add_number(dict, "tabnr", tpnr);
      dict_add_number(dict, "winnr", winnr);
      dict_add_number(dict, "winid", wp->w_id);
*** ../vim-8.2.4796/src/testdir/test_bufwintabinfo.vim  2021-11-20 
11:13:53.201671127 +0000
--- src/testdir/test_bufwintabinfo.vim  2022-04-20 18:59:44.345463137 +0100
***************
*** 172,175 ****
--- 172,197 ----
    bw!
  endfunc
  
+ func Test_getwininfo_au()
+   enew
+   call setline(1, range(1, 16))
+ 
+   let g:info = #{}
+   augroup T1
+     au!
+     au WinEnter * let g:info = getwininfo(win_getid())[0]
+   augroup END
+ 
+   4split
+   " Check that calling getwininfo() from WinEnter returns fresh values for
+   " topline and botline.
+   call assert_equal(1, g:info.topline)
+   call assert_equal(4, g:info.botline)
+   close
+ 
+   unlet g:info
+   augroup! T1
+   bwipe!
+ endfunc
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.4796/src/version.c       2022-04-20 18:41:46.153830313 +0100
--- src/version.c       2022-04-20 18:57:23.389486773 +0100
***************
*** 748,749 ****
--- 748,751 ----
  {   /* Add new patch number below this line */
+ /**/
+     4797,
  /**/

-- 
I'm not familiar with this proof, but I'm aware of a significant
following of toddlers who believe that peanut butter is the solution
to all of life's problems...            -- Tim Hammerquist

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220420180116.34D321C170F%40moolenaar.net.

Raspunde prin e-mail lui