Last active
October 11, 2016 05:02
-
-
Save ichizok/f34c9018f5e9e452d3bc78cc9026a720 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/screen.c b/src/screen.c | |
index 5ebca09..30769b3 100644 | |
--- a/src/screen.c | |
+++ b/src/screen.c | |
@@ -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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment