Mercurial > vim
comparison src/screen.c @ 9992:3e3b0ce24b61 v7.4.2269
commit https://github.com/vim/vim/commit/e17bdffff78ebd6a4e3cff26754cc667557ea810
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 27 18:34:29 2016 +0200
patch 7.4.2269
Problem: Using 'hlsearch' highlighting instead of matchpos if there is no
search match.
Solution: Pass NULL as last item to next_search_hl() when searching for
'hlsearch' match. (Shane Harper, closes #1013)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 27 Aug 2016 18:45:06 +0200 |
parents | ccb6461b82df |
children | 4aead6a9b7a9 |
comparison
equal
deleted
inserted
replaced
9991:9068d11d8309 | 9992:3e3b0ce24b61 |
---|---|
3544 shl->attr_cur = 0; | 3544 shl->attr_cur = 0; |
3545 shl->is_addpos = FALSE; | 3545 shl->is_addpos = FALSE; |
3546 v = (long)(ptr - line); | 3546 v = (long)(ptr - line); |
3547 if (cur != NULL) | 3547 if (cur != NULL) |
3548 cur->pos.cur = 0; | 3548 cur->pos.cur = 0; |
3549 next_search_hl(wp, shl, lnum, (colnr_T)v, cur); | 3549 next_search_hl(wp, shl, lnum, (colnr_T)v, |
3550 shl == &search_hl ? NULL : cur); | |
3550 | 3551 |
3551 /* Need to get the line again, a multi-line regexp may have made it | 3552 /* Need to get the line again, a multi-line regexp may have made it |
3552 * invalid. */ | 3553 * invalid. */ |
3553 line = ml_get_buf(wp->w_buffer, lnum, FALSE); | 3554 line = ml_get_buf(wp->w_buffer, lnum, FALSE); |
3554 ptr = line + v; | 3555 ptr = line + v; |
3978 { | 3979 { |
3979 shl->attr_cur = 0; | 3980 shl->attr_cur = 0; |
3980 #ifdef FEAT_CONCEAL | 3981 #ifdef FEAT_CONCEAL |
3981 prev_syntax_id = 0; | 3982 prev_syntax_id = 0; |
3982 #endif | 3983 #endif |
3983 next_search_hl(wp, shl, lnum, (colnr_T)v, cur); | 3984 next_search_hl(wp, shl, lnum, (colnr_T)v, |
3985 shl == &search_hl ? NULL : cur); | |
3984 pos_inprogress = cur == NULL || cur->pos.cur == 0 | 3986 pos_inprogress = cur == NULL || cur->pos.cur == 0 |
3985 ? FALSE : TRUE; | 3987 ? FALSE : TRUE; |
3986 | 3988 |
3987 /* Need to get the line again, a multi-line regexp | 3989 /* Need to get the line again, a multi-line regexp |
3988 * may have made it invalid. */ | 3990 * may have made it invalid. */ |
7605 pos_inprogress = TRUE; | 7607 pos_inprogress = TRUE; |
7606 n = 0; | 7608 n = 0; |
7607 while (shl->first_lnum < lnum && (shl->rm.regprog != NULL | 7609 while (shl->first_lnum < lnum && (shl->rm.regprog != NULL |
7608 || (cur != NULL && pos_inprogress))) | 7610 || (cur != NULL && pos_inprogress))) |
7609 { | 7611 { |
7610 next_search_hl(wp, shl, shl->first_lnum, (colnr_T)n, cur); | 7612 next_search_hl(wp, shl, shl->first_lnum, (colnr_T)n, |
7613 shl == &search_hl ? NULL : cur); | |
7611 pos_inprogress = cur == NULL || cur->pos.cur == 0 | 7614 pos_inprogress = cur == NULL || cur->pos.cur == 0 |
7612 ? FALSE : TRUE; | 7615 ? FALSE : TRUE; |
7613 if (shl->lnum != 0) | 7616 if (shl->lnum != 0) |
7614 { | 7617 { |
7615 shl->first_lnum = shl->lnum | 7618 shl->first_lnum = shl->lnum |