Mercurial > vim
comparison src/textprop.c @ 29607:33d7c1fa2dac v9.0.0144
patch 9.0.0144: text property cannot override 'cursorline' highlight
Commit: https://github.com/vim/vim/commit/f4ba8bc47eb3c6b5899ef31d083b9b8f0d4ca456
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Aug 5 17:05:04 2022 +0100
patch 9.0.0144: text property cannot override 'cursorline' highlight
Problem: Text property cannot override 'cursorline' highlight.
Solution: Add the "override" flag to prop_type_add(). (closes https://github.com/vim/vim/issues/5533,
closes #8225).
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 05 Aug 2022 18:15:08 +0200 |
parents | e357bc89bb95 |
children | e1c370197030 |
comparison
equal
deleted
inserted
replaced
29606:3e5d197e698e | 29607:33d7c1fa2dac |
---|---|
236 ga_init2(gap, sizeof(char *), 50); | 236 ga_init2(gap, sizeof(char *), 50); |
237 if (ga_grow(gap, 1) == FAIL) | 237 if (ga_grow(gap, 1) == FAIL) |
238 goto theend; | 238 goto theend; |
239 ((char_u **)gap->ga_data)[gap->ga_len++] = text; | 239 ((char_u **)gap->ga_data)[gap->ga_len++] = text; |
240 | 240 |
241 // change any Tab to a Space to make it simpler to compute the size | 241 // change any control character (Tab, Newline, etc.) to a Space to make |
242 // it simpler to compute the size | |
242 for (p = text; *p != NUL; MB_PTR_ADV(p)) | 243 for (p = text; *p != NUL; MB_PTR_ADV(p)) |
243 if (*p == TAB) | 244 if (*p < ' ') |
244 *p = ' '; | 245 *p = ' '; |
245 text = NULL; | 246 text = NULL; |
246 } | 247 } |
247 | 248 |
248 for (lnum = start_lnum; lnum <= end_lnum; ++lnum) | 249 for (lnum = start_lnum; lnum <= end_lnum; ++lnum) |
1540 prop->pt_flags |= PT_FLAG_COMBINE; | 1541 prop->pt_flags |= PT_FLAG_COMBINE; |
1541 else | 1542 else |
1542 prop->pt_flags &= ~PT_FLAG_COMBINE; | 1543 prop->pt_flags &= ~PT_FLAG_COMBINE; |
1543 } | 1544 } |
1544 | 1545 |
1546 di = dict_find(dict, (char_u *)"override", -1); | |
1547 if (di != NULL) | |
1548 { | |
1549 if (tv_get_bool(&di->di_tv)) | |
1550 prop->pt_flags |= PT_FLAG_OVERRIDE; | |
1551 else | |
1552 prop->pt_flags &= ~PT_FLAG_OVERRIDE; | |
1553 } | |
1554 | |
1545 di = dict_find(dict, (char_u *)"priority", -1); | 1555 di = dict_find(dict, (char_u *)"priority", -1); |
1546 if (di != NULL) | 1556 if (di != NULL) |
1547 prop->pt_priority = tv_get_number(&di->di_tv); | 1557 prop->pt_priority = tv_get_number(&di->di_tv); |
1548 | 1558 |
1549 di = dict_find(dict, (char_u *)"start_incl", -1); | 1559 di = dict_find(dict, (char_u *)"start_incl", -1); |