0
0
mirror of https://github.com/vim/vim.git synced 2025-10-02 05:04:20 -04:00

patch 8.0.0033

Problem:    Cannot use overlapping positions with matchaddpos().
Solution:   Check end of match. (Ozaki Kiichi) Add a test (Hirohito Higashi)
This commit is contained in:
Bram Moolenaar
2016-10-15 14:56:30 +02:00
parent 4575876dc8
commit a6c27ee6db
3 changed files with 20 additions and 6 deletions

View File

@@ -7786,21 +7786,23 @@ next_search_hl_pos(
shl->lnum = 0;
for (i = posmatch->cur; i < MAXPOSMATCH; i++)
{
if (posmatch->pos[i].lnum == 0)
llpos_T *pos = &posmatch->pos[i];
if (pos->lnum == 0)
break;
if (posmatch->pos[i].col < mincol)
if (pos->col + pos->len - 1 <= mincol)
continue;
if (posmatch->pos[i].lnum == lnum)
if (pos->lnum == lnum)
{
if (shl->lnum == lnum)
{
/* partially sort positions by column numbers
* on the same line */
if (posmatch->pos[i].col < posmatch->pos[bot].col)
if (pos->col < posmatch->pos[bot].col)
{
llpos_T tmp = posmatch->pos[i];
llpos_T tmp = *pos;
posmatch->pos[i] = posmatch->pos[bot];
*pos = posmatch->pos[bot];
posmatch->pos[bot] = tmp;
}
}