Mercurial > vim
comparison src/match.c @ 26334:baec4e1cee43 v8.2.3698
patch 8.2.3698: match highlighting continues over breakindent
Commit: https://github.com/vim/vim/commit/0c359af5c0fd106d3f57cc0bb7cef1c89b5e1e10
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Nov 29 19:18:57 2021 +0000
patch 8.2.3698: match highlighting continues over breakindent
Problem: Match highlighting continues over breakindent.
Solution: Stop before the end column. (closes https://github.com/vim/vim/issues/9242)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 29 Nov 2021 20:30:04 +0100 |
parents | e8e2c4d33b9b |
children | f1618f8705e4 |
comparison
equal
deleted
inserted
replaced
26333:ecabeda57f71 | 26334:baec4e1cee43 |
---|---|
701 * For a position in a line: Check for start/end of 'hlsearch' and other | 701 * For a position in a line: Check for start/end of 'hlsearch' and other |
702 * matches. | 702 * matches. |
703 * After end, check for start/end of next match. | 703 * After end, check for start/end of next match. |
704 * When another match, have to check for start again. | 704 * When another match, have to check for start again. |
705 * Watch out for matching an empty string! | 705 * Watch out for matching an empty string! |
706 * "on_last_col" is set to TRUE with non-zero search_attr and the next column | |
707 * is endcol. | |
706 * Return the updated search_attr. | 708 * Return the updated search_attr. |
707 */ | 709 */ |
708 int | 710 int |
709 update_search_hl( | 711 update_search_hl( |
710 win_T *wp, | 712 win_T *wp, |
713 char_u **line, | 715 char_u **line, |
714 match_T *search_hl, | 716 match_T *search_hl, |
715 int *has_match_conc UNUSED, | 717 int *has_match_conc UNUSED, |
716 int *match_conc UNUSED, | 718 int *match_conc UNUSED, |
717 int did_line_attr, | 719 int did_line_attr, |
718 int lcs_eol_one) | 720 int lcs_eol_one, |
721 int *on_last_col) | |
719 { | 722 { |
720 matchitem_T *cur; // points to the match list | 723 matchitem_T *cur; // points to the match list |
721 match_T *shl; // points to search_hl or a match | 724 match_T *shl; // points to search_hl or a match |
722 int shl_flag; // flag to indicate whether search_hl | 725 int shl_flag; // flag to indicate whether search_hl |
723 // has been processed or not | 726 // has been processed or not |
830 shl_flag = TRUE; | 833 shl_flag = TRUE; |
831 } | 834 } |
832 else | 835 else |
833 shl = &cur->hl; | 836 shl = &cur->hl; |
834 if (shl->attr_cur != 0) | 837 if (shl->attr_cur != 0) |
838 { | |
835 search_attr = shl->attr_cur; | 839 search_attr = shl->attr_cur; |
840 *on_last_col = col + 1 >= shl->endcol; | |
841 } | |
836 if (shl != search_hl && cur != NULL) | 842 if (shl != search_hl && cur != NULL) |
837 cur = cur->next; | 843 cur = cur->next; |
838 } | 844 } |
839 // Only highlight one character after the last column. | 845 // Only highlight one character after the last column. |
840 if (*(*line + col) == NUL && (did_line_attr >= 1 | 846 if (*(*line + col) == NUL && (did_line_attr >= 1 |