Merge pull request #4730 from jbradaric/vim-7.4.1052

vim-patch:7.4.1052
This commit is contained in:
Justin M. Keyes
2016-05-12 01:08:01 -04:00
2 changed files with 22 additions and 18 deletions

View File

@@ -2615,33 +2615,37 @@ find_endpos (
IF_SYN_TIME(&spp_skip->sp_time)); IF_SYN_TIME(&spp_skip->sp_time));
spp_skip->sp_prog = regmatch.regprog; spp_skip->sp_prog = regmatch.regprog;
if (r && regmatch.startpos[0].col <= best_regmatch.startpos[0].col) { if (r && regmatch.startpos[0].col <= best_regmatch.startpos[0].col) {
/* Add offset to skip pattern match */ // Add offset to skip pattern match
syn_add_end_off(&pos, &regmatch, spp_skip, SPO_ME_OFF, 1); syn_add_end_off(&pos, &regmatch, spp_skip, SPO_ME_OFF, 1);
/* If the skip pattern goes on to the next line, there is no // If the skip pattern goes on to the next line, there is no
* match with an end pattern in this line. */ // match with an end pattern in this line.
if (pos.lnum > startpos->lnum) if (pos.lnum > startpos->lnum) {
break; break;
}
line = ml_get_buf(syn_buf, startpos->lnum, FALSE); line = ml_get_buf(syn_buf, startpos->lnum, false);
int line_len = (int)STRLEN(line);
/* take care of an empty match or negative offset */ // take care of an empty match or negative offset
if (pos.col <= matchcol) if (pos.col <= matchcol) {
++matchcol; matchcol++;
else if (pos.col <= regmatch.endpos[0].col) } else if (pos.col <= regmatch.endpos[0].col) {
matchcol = pos.col; matchcol = pos.col;
else } else {
/* Be careful not to jump over the NUL at the end-of-line */ // Be careful not to jump over the NUL at the end-of-line
for (matchcol = regmatch.endpos[0].col; for (matchcol = regmatch.endpos[0].col;
line[matchcol] != NUL && matchcol < pos.col; matchcol < line_len && matchcol < pos.col;
++matchcol) matchcol++) {
; }
}
/* if the skip pattern includes end-of-line, break here */ // if the skip pattern includes end-of-line, break here
if (line[matchcol] == NUL) if (matchcol >= line_len) {
break; break;
}
continue; /* start with first end pattern again */ continue; // start with first end pattern again
} }
} }

View File

@@ -630,7 +630,7 @@ static int included_patches[] = {
1055, 1055,
1054, 1054,
// 1053, // 1053,
// 1052, 1052,
// 1051, // 1051,
// 1050, // 1050,
// 1049, // 1049,