Patch 9.0.0097

5 views
Skip to first unread message

Bram Moolenaar

unread,
Jul 28, 2022, 6:57:06 AM7/28/22
to vim...@googlegroups.com

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 -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages