Patch 9.0.0991
Problem:    Crash when reading help index with various options set. (Marius
            Gedminas)
Solution:   Do not set wlv.c_extra to NUL when wlv.p_extra is NULL.
            (closes #11651)
Files:      src/drawline.c, src/testdir/test_breakindent.vim


*** ../vim-9.0.0990/src/drawline.c      2022-12-01 18:37:34.490938220 +0000
--- src/drawline.c      2022-12-02 16:38:00.415143577 +0000
***************
*** 2894,2903 ****
                // into "ScreenLines".
                if (c == TAB && (!wp->w_p_list || wp->w_lcs_chars.tab1))
                {
!                   int tab_len = 0;
!                   long vcol_adjusted = wlv.vcol; // removed showbreak length
  #ifdef FEAT_LINEBREAK
!                   char_u *sbr = get_showbreak_value(wp);
  
                    // only adjust the tab_len, when at the first column
                    // after the showbreak value was drawn
--- 2894,2903 ----
                // into "ScreenLines".
                if (c == TAB && (!wp->w_p_list || wp->w_lcs_chars.tab1))
                {
!                   int     tab_len = 0;
!                   long    vcol_adjusted = wlv.vcol; // removed showbreak len
  #ifdef FEAT_LINEBREAK
!                   char_u  *sbr = get_showbreak_value(wp);
  
                    // only adjust the tab_len, when at the first column
                    // after the showbreak value was drawn
***************
*** 2917,2924 ****
--- 2917,2926 ----
  #ifdef FEAT_LINEBREAK
                    if (!wp->w_p_lbr || !wp->w_p_list)
  #endif
+                   {
                        // tab amount depends on current column
                        wlv.n_extra = tab_len;
+                   }
  #ifdef FEAT_LINEBREAK
                    else
                    {
***************
*** 2940,2948 ****
  # endif
                        if (tab_len > 0)
                        {
!                           // If wlv.n_extra > 0, it gives the number of
!                           // chars, to use for a tab, else we need to
!                           // calculate the width for a tab.
                            int tab2_len = mb_char2len(wp->w_lcs_chars.tab2);
                            len = tab_len * tab2_len;
                            if (wp->w_lcs_chars.tab3)
--- 2942,2950 ----
  # endif
                        if (tab_len > 0)
                        {
!                           // If wlv.n_extra > 0, it gives the number of chars
!                           // to use for a tab, else we need to calculate the
!                           // width for a tab.
                            int tab2_len = mb_char2len(wp->w_lcs_chars.tab2);
                            len = tab_len * tab2_len;
                            if (wp->w_lcs_chars.tab3)
***************
*** 3018,3024 ****
                                                        ? wp->w_lcs_chars.tab3
                                                        : wp->w_lcs_chars.tab1;
  #ifdef FEAT_LINEBREAK
!                       if (wp->w_p_lbr)
                            wlv.c_extra = NUL; // using p_extra from above
                        else
  #endif
--- 3020,3026 ----
                                                        ? wp->w_lcs_chars.tab3
                                                        : wp->w_lcs_chars.tab1;
  #ifdef FEAT_LINEBREAK
!                       if (wp->w_p_lbr && wlv.p_extra != NULL)
                            wlv.c_extra = NUL; // using p_extra from above
                        else
  #endif
*** ../vim-9.0.0990/src/testdir/test_breakindent.vim    2022-10-13 
21:54:23.962227932 +0100
--- src/testdir/test_breakindent.vim    2022-12-02 16:37:12.107174210 +0000
***************
*** 1034,1037 ****
--- 1034,1055 ----
    bwipeout!
  endfunc
  
+ func Test_linebreak_list()
+   " This was setting wlv.c_extra to NUL while wlv.p_extra is NULL
+   filetype plugin on
+   syntax enable
+   edit! $VIMRUNTIME/doc/index.txt
+   /v_P
+ 
+   setlocal list
+   setlocal listchars=tab:>-
+   setlocal linebreak
+   setlocal nowrap
+   setlocal filetype=help
+   redraw!
+ 
+   bwipe!
+ endfunc
+ 
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-9.0.0990/src/version.c       2022-12-02 15:58:34.614705476 +0000
--- src/version.c       2022-12-02 16:18:45.540445599 +0000
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     991,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
208. Your goals for the future are obtaining a second Gbit connection
        and upgrade your NAS to all SSD

 /// 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/20221202164006.C6E331C007B%40moolenaar.net.

Raspunde prin e-mail lui