Patch 9.0.0097
Problem:    Long quickfix line is truncated for :clist.
Solution:   Allocate a buffer if needed.
Files:      src/quickfix.c, src/testdir/test_quickfix.vim


*** ../vim-9.0.0096/src/quickfix.c      2022-07-23 09:52:00.337814264 +0100
--- src/quickfix.c      2022-07-28 11:55:30.063100436 +0100
***************
*** 3622,3634 ****
      }
      msg_puts(" ");
  
!     // Remove newlines and leading whitespace from the text.  For an
!     // unrecognized line keep the indent, the compiler may mark a word
!     // with ^^^^.
!     qf_fmt_text((fname != NULL || qfp->qf_lnum != 0)
!                               ? skipwhite(qfp->qf_text) : qfp->qf_text,
!                               IObuff, IOSIZE);
!     msg_prt_line(IObuff, FALSE);
      out_flush();              // show one line at a time
  }
  
--- 3622,3652 ----
      }
      msg_puts(" ");
  
!     {
!       char_u *tbuf = IObuff;
!       size_t  tbuflen = IOSIZE;
!       size_t  len = STRLEN(qfp->qf_text) + 3;
! 
!       if (len > IOSIZE)
!       {
!           tbuf = alloc(len);
!           if (tbuf != NULL)
!               tbuflen = len;
!           else
!               tbuf = IObuff;
!       }
! 
!       // Remove newlines and leading whitespace from the text.  For an
!       // unrecognized line keep the indent, the compiler may mark a word
!       // with ^^^^.
!       qf_fmt_text((fname != NULL || qfp->qf_lnum != 0)
!                                   ? skipwhite(qfp->qf_text) : qfp->qf_text,
!                                   tbuf, tbuflen);
!       msg_prt_line(tbuf, FALSE);
! 
!       if (tbuf != IObuff)
!           vim_free(tbuf);
!     }
      out_flush();              // show one line at a time
  }
  
*** ../vim-9.0.0096/src/testdir/test_quickfix.vim       2022-07-03 
14:20:44.788010407 +0100
--- src/testdir/test_quickfix.vim       2022-07-28 11:54:39.479185150 +0100
***************
*** 185,190 ****
--- 185,198 ----
        \ ' 2 Data.Text:20 col 10 warning  22: ModuleWarning',
        \ ' 3 Data/Text.hs:30 col 15 warning  33: FileWarning'], l)
  
+   " Very long line should be displayed.
+   let text = 'Line' .. repeat('1234567890', 130)
+   let lines = ['Xtestfile9:2:9:' .. text]
+   Xgetexpr lines
+ 
+   let l = split(execute('Xlist', ''), "\n")
+   call assert_equal([' 1 Xtestfile9:2 col 9: ' .. text] , l)
+ 
    " For help entries in the quickfix list, only the filename without directory
    " should be displayed
    Xhelpgrep setqflist()
*** ../vim-9.0.0096/src/version.c       2022-07-27 18:26:00.149928207 +0100
--- src/version.c       2022-07-28 11:49:01.907732168 +0100
***************
*** 737,738 ****
--- 737,740 ----
  {   /* Add new patch number below this line */
+ /**/
+     97,
  /**/

-- 
You're as much use as a condom machine at the Vatican.
                  -- Rimmer to Holly in Red Dwarf 'Queeg'

 /// 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/20220728105656.B4C681C0C6E%40moolenaar.net.

Raspunde prin e-mail lui