mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.0.0026
Problem: Error format with %W, %C and %Z does not work. (Gerd Wachsmuth) Solution: Skip code when qf_multiignore is set. (Lcd)
This commit is contained in:
@@ -1010,39 +1010,42 @@ restofline:
|
|||||||
}
|
}
|
||||||
else if (vim_strchr((char_u *)"CZ", idx) != NULL)
|
else if (vim_strchr((char_u *)"CZ", idx) != NULL)
|
||||||
{ /* continuation of multi-line msg */
|
{ /* continuation of multi-line msg */
|
||||||
qfline_T *qfprev = qi->qf_lists[qi->qf_curlist].qf_last;
|
if (!qi->qf_multiignore)
|
||||||
|
|
||||||
if (qfprev == NULL)
|
|
||||||
return QF_FAIL;
|
|
||||||
if (*fields->errmsg && !qi->qf_multiignore)
|
|
||||||
{
|
{
|
||||||
len = (int)STRLEN(qfprev->qf_text);
|
qfline_T *qfprev = qi->qf_lists[qi->qf_curlist].qf_last;
|
||||||
if ((ptr = alloc((unsigned)(len + STRLEN(fields->errmsg) + 2)))
|
|
||||||
== NULL)
|
|
||||||
return QF_FAIL;
|
|
||||||
STRCPY(ptr, qfprev->qf_text);
|
|
||||||
vim_free(qfprev->qf_text);
|
|
||||||
qfprev->qf_text = ptr;
|
|
||||||
*(ptr += len) = '\n';
|
|
||||||
STRCPY(++ptr, fields->errmsg);
|
|
||||||
}
|
|
||||||
if (qfprev->qf_nr == -1)
|
|
||||||
qfprev->qf_nr = fields->enr;
|
|
||||||
if (vim_isprintc(fields->type) && !qfprev->qf_type)
|
|
||||||
/* only printable chars allowed */
|
|
||||||
qfprev->qf_type = fields->type;
|
|
||||||
|
|
||||||
if (!qfprev->qf_lnum)
|
if (qfprev == NULL)
|
||||||
qfprev->qf_lnum = fields->lnum;
|
return QF_FAIL;
|
||||||
if (!qfprev->qf_col)
|
if (*fields->errmsg && !qi->qf_multiignore)
|
||||||
qfprev->qf_col = fields->col;
|
{
|
||||||
qfprev->qf_viscol = fields->use_viscol;
|
len = (int)STRLEN(qfprev->qf_text);
|
||||||
if (!qfprev->qf_fnum)
|
if ((ptr = alloc((unsigned)(len + STRLEN(fields->errmsg) + 2)))
|
||||||
qfprev->qf_fnum = qf_get_fnum(qi, qi->qf_directory,
|
== NULL)
|
||||||
*fields->namebuf || qi->qf_directory != NULL
|
return QF_FAIL;
|
||||||
? fields->namebuf
|
STRCPY(ptr, qfprev->qf_text);
|
||||||
: qi->qf_currfile != NULL && fields->valid
|
vim_free(qfprev->qf_text);
|
||||||
? qi->qf_currfile : 0);
|
qfprev->qf_text = ptr;
|
||||||
|
*(ptr += len) = '\n';
|
||||||
|
STRCPY(++ptr, fields->errmsg);
|
||||||
|
}
|
||||||
|
if (qfprev->qf_nr == -1)
|
||||||
|
qfprev->qf_nr = fields->enr;
|
||||||
|
if (vim_isprintc(fields->type) && !qfprev->qf_type)
|
||||||
|
/* only printable chars allowed */
|
||||||
|
qfprev->qf_type = fields->type;
|
||||||
|
|
||||||
|
if (!qfprev->qf_lnum)
|
||||||
|
qfprev->qf_lnum = fields->lnum;
|
||||||
|
if (!qfprev->qf_col)
|
||||||
|
qfprev->qf_col = fields->col;
|
||||||
|
qfprev->qf_viscol = fields->use_viscol;
|
||||||
|
if (!qfprev->qf_fnum)
|
||||||
|
qfprev->qf_fnum = qf_get_fnum(qi, qi->qf_directory,
|
||||||
|
*fields->namebuf || qi->qf_directory != NULL
|
||||||
|
? fields->namebuf
|
||||||
|
: qi->qf_currfile != NULL && fields->valid
|
||||||
|
? qi->qf_currfile : 0);
|
||||||
|
}
|
||||||
if (idx == 'Z')
|
if (idx == 'Z')
|
||||||
qi->qf_multiline = qi->qf_multiignore = FALSE;
|
qi->qf_multiline = qi->qf_multiignore = FALSE;
|
||||||
line_breakcheck();
|
line_breakcheck();
|
||||||
|
@@ -818,6 +818,29 @@ function! Test_efm_dirstack()
|
|||||||
call delete('habits1.txt')
|
call delete('habits1.txt')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Test for resync after continuing an ignored message
|
||||||
|
function! Xefm_ignore_continuations(cchar)
|
||||||
|
call s:setup_commands(a:cchar)
|
||||||
|
|
||||||
|
let save_efm = &efm
|
||||||
|
|
||||||
|
let &efm =
|
||||||
|
\ '%Eerror %m %l,' .
|
||||||
|
\ '%-Wignored %m %l,' .
|
||||||
|
\ '%+Cmore ignored %m %l,' .
|
||||||
|
\ '%Zignored end'
|
||||||
|
Xgetexpr ['ignored warning 1', 'more ignored continuation 2', 'ignored end', 'error resync 4']
|
||||||
|
let l = map(g:Xgetlist(), '[v:val.text, v:val.valid, v:val.lnum, v:val.type]')
|
||||||
|
call assert_equal([['resync', 1, 4, 'E']], l)
|
||||||
|
|
||||||
|
let &efm = save_efm
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! Test_efm_ignore_continuations()
|
||||||
|
call Xefm_ignore_continuations('c')
|
||||||
|
call Xefm_ignore_continuations('l')
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Tests for invalid error format specifies
|
" Tests for invalid error format specifies
|
||||||
function Xinvalid_efm_Tests(cchar)
|
function Xinvalid_efm_Tests(cchar)
|
||||||
call s:setup_commands(a:cchar)
|
call s:setup_commands(a:cchar)
|
||||||
|
@@ -764,6 +764,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 */
|
||||||
|
/**/
|
||||||
|
26,
|
||||||
/**/
|
/**/
|
||||||
25,
|
25,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user