comparison src/quickfix.c @ 10257:2d0e6034743a v8.0.0026

commit https://github.com/vim/vim/commit/9b4579481892a62e7e002498b9eddaaf75bbda49 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Oct 9 16:10:05 2016 +0200 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)
author Christian Brabandt <cb@256bit.org>
date Sun, 09 Oct 2016 16:15:04 +0200
parents 197795e3530d
children 92fa8e5ef210
comparison
equal deleted inserted replaced
10256:965becff2d27 10257:2d0e6034743a
1008 qi->qf_multiline = TRUE; /* start of a multi-line message */ 1008 qi->qf_multiline = TRUE; /* start of a multi-line message */
1009 qi->qf_multiignore = FALSE; /* reset continuation */ 1009 qi->qf_multiignore = FALSE; /* reset continuation */
1010 } 1010 }
1011 else if (vim_strchr((char_u *)"CZ", idx) != NULL) 1011 else if (vim_strchr((char_u *)"CZ", idx) != NULL)
1012 { /* continuation of multi-line msg */ 1012 { /* continuation of multi-line msg */
1013 qfline_T *qfprev = qi->qf_lists[qi->qf_curlist].qf_last; 1013 if (!qi->qf_multiignore)
1014 1014 {
1015 if (qfprev == NULL) 1015 qfline_T *qfprev = qi->qf_lists[qi->qf_curlist].qf_last;
1016 return QF_FAIL; 1016
1017 if (*fields->errmsg && !qi->qf_multiignore) 1017 if (qfprev == NULL)
1018 {
1019 len = (int)STRLEN(qfprev->qf_text);
1020 if ((ptr = alloc((unsigned)(len + STRLEN(fields->errmsg) + 2)))
1021 == NULL)
1022 return QF_FAIL; 1018 return QF_FAIL;
1023 STRCPY(ptr, qfprev->qf_text); 1019 if (*fields->errmsg && !qi->qf_multiignore)
1024 vim_free(qfprev->qf_text); 1020 {
1025 qfprev->qf_text = ptr; 1021 len = (int)STRLEN(qfprev->qf_text);
1026 *(ptr += len) = '\n'; 1022 if ((ptr = alloc((unsigned)(len + STRLEN(fields->errmsg) + 2)))
1027 STRCPY(++ptr, fields->errmsg); 1023 == NULL)
1028 } 1024 return QF_FAIL;
1029 if (qfprev->qf_nr == -1) 1025 STRCPY(ptr, qfprev->qf_text);
1030 qfprev->qf_nr = fields->enr; 1026 vim_free(qfprev->qf_text);
1031 if (vim_isprintc(fields->type) && !qfprev->qf_type) 1027 qfprev->qf_text = ptr;
1032 /* only printable chars allowed */ 1028 *(ptr += len) = '\n';
1033 qfprev->qf_type = fields->type; 1029 STRCPY(++ptr, fields->errmsg);
1034 1030 }
1035 if (!qfprev->qf_lnum) 1031 if (qfprev->qf_nr == -1)
1036 qfprev->qf_lnum = fields->lnum; 1032 qfprev->qf_nr = fields->enr;
1037 if (!qfprev->qf_col) 1033 if (vim_isprintc(fields->type) && !qfprev->qf_type)
1038 qfprev->qf_col = fields->col; 1034 /* only printable chars allowed */
1039 qfprev->qf_viscol = fields->use_viscol; 1035 qfprev->qf_type = fields->type;
1040 if (!qfprev->qf_fnum) 1036
1041 qfprev->qf_fnum = qf_get_fnum(qi, qi->qf_directory, 1037 if (!qfprev->qf_lnum)
1042 *fields->namebuf || qi->qf_directory != NULL 1038 qfprev->qf_lnum = fields->lnum;
1043 ? fields->namebuf 1039 if (!qfprev->qf_col)
1044 : qi->qf_currfile != NULL && fields->valid 1040 qfprev->qf_col = fields->col;
1045 ? qi->qf_currfile : 0); 1041 qfprev->qf_viscol = fields->use_viscol;
1042 if (!qfprev->qf_fnum)
1043 qfprev->qf_fnum = qf_get_fnum(qi, qi->qf_directory,
1044 *fields->namebuf || qi->qf_directory != NULL
1045 ? fields->namebuf
1046 : qi->qf_currfile != NULL && fields->valid
1047 ? qi->qf_currfile : 0);
1048 }
1046 if (idx == 'Z') 1049 if (idx == 'Z')
1047 qi->qf_multiline = qi->qf_multiignore = FALSE; 1050 qi->qf_multiline = qi->qf_multiignore = FALSE;
1048 line_breakcheck(); 1051 line_breakcheck();
1049 return QF_IGNORE_LINE; 1052 return QF_IGNORE_LINE;
1050 } 1053 }