forked from aniani/vim
patch 7.4.2081
Problem: Line numbers in the error list are not always adjusted. Solution: Set b_has_qf_entry properly. (Yegappan Lakshmanan)
This commit is contained in:
@@ -1408,7 +1408,8 @@ qf_add_entry(
|
|||||||
|
|
||||||
qfp->qf_fnum = bufnum;
|
qfp->qf_fnum = bufnum;
|
||||||
if (buf != NULL)
|
if (buf != NULL)
|
||||||
buf->b_has_qf_entry = TRUE;
|
buf->b_has_qf_entry |=
|
||||||
|
(qi == &ql_info) ? BUF_HAS_QF_ENTRY : BUF_HAS_LL_ENTRY;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
qfp->qf_fnum = qf_get_fnum(qi, dir, fname);
|
qfp->qf_fnum = qf_get_fnum(qi, dir, fname);
|
||||||
@@ -1680,7 +1681,8 @@ qf_get_fnum(qf_info_T *qi, char_u *directory, char_u *fname)
|
|||||||
if (buf == NULL)
|
if (buf == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
buf->b_has_qf_entry = TRUE;
|
buf->b_has_qf_entry =
|
||||||
|
(qi == &ql_info) ? BUF_HAS_QF_ENTRY : BUF_HAS_LL_ENTRY;
|
||||||
return buf->b_fnum;
|
return buf->b_fnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2728,8 +2730,9 @@ qf_mark_adjust(
|
|||||||
int idx;
|
int idx;
|
||||||
qf_info_T *qi = &ql_info;
|
qf_info_T *qi = &ql_info;
|
||||||
int found_one = FALSE;
|
int found_one = FALSE;
|
||||||
|
int buf_has_flag = wp == NULL ? BUF_HAS_QF_ENTRY : BUF_HAS_LL_ENTRY;
|
||||||
|
|
||||||
if (!curbuf->b_has_qf_entry)
|
if (!(curbuf->b_has_qf_entry & buf_has_flag))
|
||||||
return;
|
return;
|
||||||
if (wp != NULL)
|
if (wp != NULL)
|
||||||
{
|
{
|
||||||
@@ -2758,7 +2761,7 @@ qf_mark_adjust(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!found_one)
|
if (!found_one)
|
||||||
curbuf->b_has_qf_entry = FALSE;
|
curbuf->b_has_qf_entry &= ~buf_has_flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -1906,6 +1906,8 @@ struct file_buffer
|
|||||||
#ifdef FEAT_QUICKFIX
|
#ifdef FEAT_QUICKFIX
|
||||||
char_u *b_p_bh; /* 'bufhidden' */
|
char_u *b_p_bh; /* 'bufhidden' */
|
||||||
char_u *b_p_bt; /* 'buftype' */
|
char_u *b_p_bt; /* 'buftype' */
|
||||||
|
#define BUF_HAS_QF_ENTRY 1
|
||||||
|
#define BUF_HAS_LL_ENTRY 2
|
||||||
int b_has_qf_entry;
|
int b_has_qf_entry;
|
||||||
#endif
|
#endif
|
||||||
int b_p_bl; /* 'buflisted' */
|
int b_p_bl; /* 'buflisted' */
|
||||||
|
@@ -1341,13 +1341,14 @@ function! Xadjust_qflnum(cchar)
|
|||||||
|
|
||||||
enew | only
|
enew | only
|
||||||
|
|
||||||
call s:create_test_file('Xqftestfile')
|
let fname = 'Xqftestfile' . a:cchar
|
||||||
edit Xqftestfile
|
call s:create_test_file(fname)
|
||||||
|
exe 'edit ' . fname
|
||||||
|
|
||||||
Xgetexpr ['Xqftestfile:5:Line5',
|
Xgetexpr [fname . ':5:Line5',
|
||||||
\ 'Xqftestfile:10:Line10',
|
\ fname . ':10:Line10',
|
||||||
\ 'Xqftestfile:15:Line15',
|
\ fname . ':15:Line15',
|
||||||
\ 'Xqftestfile:20:Line20']
|
\ fname . ':20:Line20']
|
||||||
|
|
||||||
6,14delete
|
6,14delete
|
||||||
call append(6, ['Buffer', 'Window'])
|
call append(6, ['Buffer', 'Window'])
|
||||||
@@ -1359,11 +1360,13 @@ function! Xadjust_qflnum(cchar)
|
|||||||
call assert_equal(13, l[3].lnum)
|
call assert_equal(13, l[3].lnum)
|
||||||
|
|
||||||
enew!
|
enew!
|
||||||
call delete('Xqftestfile')
|
call delete(fname)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! Test_adjust_lnum()
|
function! Test_adjust_lnum()
|
||||||
|
call setloclist(0, [])
|
||||||
call Xadjust_qflnum('c')
|
call Xadjust_qflnum('c')
|
||||||
|
call setqflist([])
|
||||||
call Xadjust_qflnum('l')
|
call Xadjust_qflnum('l')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@@ -758,6 +758,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2081,
|
||||||
/**/
|
/**/
|
||||||
2080,
|
2080,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user