Skip to content

Commit e333e79

Browse files
committed
patch 8.0.1678: errorformat "%r" implies "%>"
Problem: Errorformat "%r" implies "%>". (Jan Gosmann) Solution: Jump to before setting fmt_ptr. (Yegappan Lakshmanan, closes #2785)
1 parent ea39176 commit e333e79

3 files changed

Lines changed: 26 additions & 1 deletion

File tree

‎src/quickfix.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,7 @@ qf_parse_line(
844844
/* Always ignore case when looking for a matching error. */
845845
regmatch.rm_ic = TRUE;
846846

847+
restofline:
847848
/* If there was no %> item start at the first pattern */
848849
if (fmt_start == NULL)
849850
fmt_ptr = fmt_first;
@@ -858,7 +859,6 @@ qf_parse_line(
858859
* match or no match.
859860
*/
860861
fields->valid = TRUE;
861-
restofline:
862862
for ( ; fmt_ptr != NULL; fmt_ptr = fmt_ptr->next)
863863
{
864864
int r;

‎src/testdir/test_quickfix.vim‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2582,6 +2582,29 @@ func Xmultifilestack_tests(cchar)
25822582
call assert_equal(3, l1.items[1].lnum)
25832583
call assert_equal('two.txt', bufname(l2.items[1].bufnr))
25842584
call assert_equal(5, l2.items[1].lnum)
2585+
2586+
" Test for start of a new error line in the same line where a previous
2587+
" error line ends with a file stack.
2588+
let efm_val = 'Error\ l%l\ in\ %f,'
2589+
let efm_val .= '%-P%>(%f%r,Error\ l%l\ in\ %m,%-Q)%r'
2590+
let l = g:Xgetlist({'lines' : [
2591+
\ '(one.txt',
2592+
\ 'Error l4 in one.txt',
2593+
\ ') (two.txt',
2594+
\ 'Error l6 in two.txt',
2595+
\ ')',
2596+
\ 'Error l8 in one.txt'
2597+
\ ], 'efm' : efm_val})
2598+
call assert_equal(3, len(l.items))
2599+
call assert_equal('one.txt', bufname(l.items[0].bufnr))
2600+
call assert_equal(4, l.items[0].lnum)
2601+
call assert_equal('one.txt', l.items[0].text)
2602+
call assert_equal('two.txt', bufname(l.items[1].bufnr))
2603+
call assert_equal(6, l.items[1].lnum)
2604+
call assert_equal('two.txt', l.items[1].text)
2605+
call assert_equal('one.txt', bufname(l.items[2].bufnr))
2606+
call assert_equal(8, l.items[2].lnum)
2607+
call assert_equal('', l.items[2].text)
25852608
endfunc
25862609

25872610
func Test_multifilestack()

‎src/version.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,8 @@ static char *(features[]) =
762762

763763
static int included_patches[] =
764764
{ /* Add new patch number below this line */
765+
/**/
766+
1678,
765767
/**/
766768
1677,
767769
/**/

0 commit comments

Comments
 (0)