Mercurial > vim
comparison src/drawline.c @ 31221:59de2172e99d v9.0.0944
patch 9.0.0944: 'cursorline' causes virtual text highlight to continue
Commit: https://github.com/vim/vim/commit/6ac16f0c0fe923098b9df5ac430f1923045f16ea
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 24 22:42:29 2022 +0000
patch 9.0.0944: 'cursorline' causes virtual text highlight to continue
Problem: 'cursorline' causes virtual text highlight to continue.
Solution: Save and restore line_attr. (closes https://github.com/vim/vim/issues/11588)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 24 Nov 2022 23:45:02 +0100 |
parents | 7b16ac81a349 |
children | 30377fd8341e |
comparison
equal
deleted
inserted
replaced
31220:f6ea17595824 | 31221:59de2172e99d |
---|---|
946 { | 946 { |
947 if (wlv->saved_n_extra > 0) | 947 if (wlv->saved_n_extra > 0) |
948 { | 948 { |
949 // Continue item from end of wrapped line. | 949 // Continue item from end of wrapped line. |
950 wlv->n_extra = wlv->saved_n_extra; | 950 wlv->n_extra = wlv->saved_n_extra; |
951 wlv->saved_n_extra = 0; | |
951 wlv->c_extra = wlv->saved_c_extra; | 952 wlv->c_extra = wlv->saved_c_extra; |
952 wlv->c_final = wlv->saved_c_final; | 953 wlv->c_final = wlv->saved_c_final; |
953 wlv->p_extra = wlv->saved_p_extra; | 954 wlv->p_extra = wlv->saved_p_extra; |
954 wlv->extra_attr = wlv->saved_extra_attr; | 955 wlv->extra_attr = wlv->saved_extra_attr; |
955 wlv->extra_for_textprop = wlv->saved_extra_for_textprop; | 956 wlv->extra_for_textprop = wlv->saved_extra_for_textprop; |
1044 int text_prop_above = FALSE; // first doing virtual text above | 1045 int text_prop_above = FALSE; // first doing virtual text above |
1045 int text_prop_follows = FALSE; // another text prop to display | 1046 int text_prop_follows = FALSE; // another text prop to display |
1046 int saved_search_attr = 0; // search_attr to be used when n_extra | 1047 int saved_search_attr = 0; // search_attr to be used when n_extra |
1047 // goes to zero | 1048 // goes to zero |
1048 int saved_area_attr = 0; // idem for area_attr | 1049 int saved_area_attr = 0; // idem for area_attr |
1050 int reset_extra_attr = FALSE; | |
1049 #endif | 1051 #endif |
1050 #ifdef FEAT_SPELL | 1052 #ifdef FEAT_SPELL |
1051 int has_spell = FALSE; // this buffer has spell checking | 1053 int has_spell = FALSE; // this buffer has spell checking |
1052 int can_spell = FALSE; | 1054 int can_spell = FALSE; |
1053 # define SPWORDLEN 150 | 1055 # define SPWORDLEN 150 |
1917 text_prop_attr = 0; | 1919 text_prop_attr = 0; |
1918 text_prop_attr_comb = 0; | 1920 text_prop_attr_comb = 0; |
1919 text_prop_flags = 0; | 1921 text_prop_flags = 0; |
1920 text_prop_type = NULL; | 1922 text_prop_type = NULL; |
1921 text_prop_id = 0; | 1923 text_prop_id = 0; |
1924 reset_extra_attr = FALSE; | |
1922 } | 1925 } |
1923 if (text_props_active > 0 && wlv.n_extra == 0) | 1926 if (text_props_active > 0 && wlv.n_extra == 0) |
1924 { | 1927 { |
1925 int used_tpi = -1; | 1928 int used_tpi = -1; |
1926 int used_attr = 0; | 1929 int used_attr = 0; |
2401 if (wlv.n_extra <= 0) | 2404 if (wlv.n_extra <= 0) |
2402 { | 2405 { |
2403 wlv.extra_for_textprop = FALSE; | 2406 wlv.extra_for_textprop = FALSE; |
2404 in_linebreak = FALSE; | 2407 in_linebreak = FALSE; |
2405 | 2408 |
2406 // only restore search_attr and area_attr after extra in the | 2409 // Only restore search_attr and area_attr after "n_extra" in |
2407 // next screen line is also done | 2410 // the next screen line is also done. |
2408 if (wlv.saved_n_extra <= 0) | 2411 if (wlv.saved_n_extra <= 0) |
2409 { | 2412 { |
2410 if (search_attr == 0) | 2413 if (search_attr == 0) |
2411 search_attr = saved_search_attr; | 2414 search_attr = saved_search_attr; |
2412 if (area_attr == 0 && *ptr != NUL) | 2415 if (area_attr == 0 && *ptr != NUL) |
2413 area_attr = saved_area_attr; | 2416 area_attr = saved_area_attr; |
2417 // wlv.extra_attr should be used at this position but not | |
2418 // any further. | |
2419 reset_extra_attr = TRUE; | |
2414 } | 2420 } |
2415 } | 2421 } |
2416 #endif | 2422 #endif |
2417 } | 2423 } |
2418 else | 2424 else |
3315 if (line_attr) | 3321 if (line_attr) |
3316 wlv.char_attr = hl_combine_attr(line_attr, wlv.extra_attr); | 3322 wlv.char_attr = hl_combine_attr(line_attr, wlv.extra_attr); |
3317 else | 3323 else |
3318 #endif | 3324 #endif |
3319 wlv.char_attr = wlv.extra_attr; | 3325 wlv.char_attr = wlv.extra_attr; |
3326 #ifdef FEAT_PROP_POPUP | |
3327 if (reset_extra_attr) | |
3328 { | |
3329 reset_extra_attr = FALSE; | |
3330 wlv.extra_attr = 0; | |
3331 } | |
3332 #endif | |
3320 } | 3333 } |
3321 | 3334 |
3322 #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK) | 3335 #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK) |
3323 // XIM don't send preedit_start and preedit_end, but they send | 3336 // XIM don't send preedit_start and preedit_end, but they send |
3324 // preedit_changed and commit. Thus Vim can't set "im_is_active", use | 3337 // preedit_changed and commit. Thus Vim can't set "im_is_active", use |