Mercurial > vim
comparison src/screen.c @ 10273:489eae19cad9 v8.0.0033
commit https://github.com/vim/vim/commit/a6c27ee6db2c328e0ab0e6d143e2a295a0bb9c9a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 15 14:56:30 2016 +0200
patch 8.0.0033
Problem: Cannot use overlapping positions with matchaddpos().
Solution: Check end of match. (Ozaki Kiichi) Add a test (Hirohito Higashi)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 15 Oct 2016 15:00:04 +0200 |
parents | d54d4a258b96 |
children | 1c1fcf515607 |
comparison
equal
deleted
inserted
replaced
10272:57b2b8268d3a | 10273:489eae19cad9 |
---|---|
7784 int bot = -1; | 7784 int bot = -1; |
7785 | 7785 |
7786 shl->lnum = 0; | 7786 shl->lnum = 0; |
7787 for (i = posmatch->cur; i < MAXPOSMATCH; i++) | 7787 for (i = posmatch->cur; i < MAXPOSMATCH; i++) |
7788 { | 7788 { |
7789 if (posmatch->pos[i].lnum == 0) | 7789 llpos_T *pos = &posmatch->pos[i]; |
7790 | |
7791 if (pos->lnum == 0) | |
7790 break; | 7792 break; |
7791 if (posmatch->pos[i].col < mincol) | 7793 if (pos->col + pos->len - 1 <= mincol) |
7792 continue; | 7794 continue; |
7793 if (posmatch->pos[i].lnum == lnum) | 7795 if (pos->lnum == lnum) |
7794 { | 7796 { |
7795 if (shl->lnum == lnum) | 7797 if (shl->lnum == lnum) |
7796 { | 7798 { |
7797 /* partially sort positions by column numbers | 7799 /* partially sort positions by column numbers |
7798 * on the same line */ | 7800 * on the same line */ |
7799 if (posmatch->pos[i].col < posmatch->pos[bot].col) | 7801 if (pos->col < posmatch->pos[bot].col) |
7800 { | 7802 { |
7801 llpos_T tmp = posmatch->pos[i]; | 7803 llpos_T tmp = *pos; |
7802 | 7804 |
7803 posmatch->pos[i] = posmatch->pos[bot]; | 7805 *pos = posmatch->pos[bot]; |
7804 posmatch->pos[bot] = tmp; | 7806 posmatch->pos[bot] = tmp; |
7805 } | 7807 } |
7806 } | 7808 } |
7807 else | 7809 else |
7808 { | 7810 { |