diff options
| author | Bram Moolenaar <Bram@vim.org> | 2016-10-09 16:10:05 +0200 |
|---|---|---|
| committer | Bram Moolenaar <Bram@vim.org> | 2016-10-09 16:10:05 +0200 |
| commit | 9b4579481892a62e7e002498b9eddaaf75bbda49 (patch) | |
| tree | c407ef083ad5e3972296d0bf6a6ef165ac0665d2 /src/quickfix.c | |
| parent | 936c48f8ca82a0257640c8c9d0792538f5a7e813 (diff) | |
| download | vim-git-9b4579481892a62e7e002498b9eddaaf75bbda49.tar.gz | |
patch 8.0.0026v8.0.0026
Problem: Error format with %W, %C and %Z does not work. (Gerd Wachsmuth)
Solution: Skip code when qf_multiignore is set. (Lcd)
Diffstat (limited to 'src/quickfix.c')
| -rw-r--r-- | src/quickfix.c | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/src/quickfix.c b/src/quickfix.c index 52abbebd1..913966348 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -1010,39 +1010,42 @@ restofline: } else if (vim_strchr((char_u *)"CZ", idx) != NULL) { /* continuation of multi-line msg */ - qfline_T *qfprev = qi->qf_lists[qi->qf_curlist].qf_last; - - if (qfprev == NULL) - return QF_FAIL; - if (*fields->errmsg && !qi->qf_multiignore) + if (!qi->qf_multiignore) { - len = (int)STRLEN(qfprev->qf_text); - if ((ptr = alloc((unsigned)(len + STRLEN(fields->errmsg) + 2))) - == NULL) + qfline_T *qfprev = qi->qf_lists[qi->qf_curlist].qf_last; + + if (qfprev == 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 (*fields->errmsg && !qi->qf_multiignore) + { + len = (int)STRLEN(qfprev->qf_text); + 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) + 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 (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') qi->qf_multiline = qi->qf_multiignore = FALSE; line_breakcheck(); |
