To: vim_dev@googlegroups.com Subject: Patch 9.0.0944 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0944 Problem: 'cursorline' causes virtual text highlight to continue. Solution: Save and restore line_attr. (closes #11588) Files: src/drawline.c, src/testdir/test_textprop.vim, src/testdir/dumps/Test_prop_with_text_after_below_trunc_1.dump, src/testdir/dumps/Test_prop_with_text_after_below_trunc_2.dump, src/testdir/dumps/Test_prop_with_text_after_below_trunc_3.dump *** ../vim-9.0.0943/src/drawline.c 2022-11-18 23:13:27.050157746 +0000 --- src/drawline.c 2022-11-24 22:41:31.315526365 +0000 *************** *** 948,953 **** --- 948,954 ---- { // Continue item from end of wrapped line. wlv->n_extra = wlv->saved_n_extra; + wlv->saved_n_extra = 0; wlv->c_extra = wlv->saved_c_extra; wlv->c_final = wlv->saved_c_final; wlv->p_extra = wlv->saved_p_extra; *************** *** 1046,1051 **** --- 1047,1053 ---- int saved_search_attr = 0; // search_attr to be used when n_extra // goes to zero int saved_area_attr = 0; // idem for area_attr + int reset_extra_attr = FALSE; #endif #ifdef FEAT_SPELL int has_spell = FALSE; // this buffer has spell checking *************** *** 1919,1924 **** --- 1921,1927 ---- text_prop_flags = 0; text_prop_type = NULL; text_prop_id = 0; + reset_extra_attr = FALSE; } if (text_props_active > 0 && wlv.n_extra == 0) { *************** *** 2403,2416 **** wlv.extra_for_textprop = FALSE; in_linebreak = FALSE; ! // only restore search_attr and area_attr after extra in the ! // next screen line is also done if (wlv.saved_n_extra <= 0) { if (search_attr == 0) search_attr = saved_search_attr; if (area_attr == 0 && *ptr != NUL) area_attr = saved_area_attr; } } #endif --- 2406,2422 ---- wlv.extra_for_textprop = FALSE; in_linebreak = FALSE; ! // Only restore search_attr and area_attr after "n_extra" in ! // the next screen line is also done. if (wlv.saved_n_extra <= 0) { if (search_attr == 0) search_attr = saved_search_attr; if (area_attr == 0 && *ptr != NUL) area_attr = saved_area_attr; + // wlv.extra_attr should be used at this position but not + // any further. + reset_extra_attr = TRUE; } } #endif *************** *** 3317,3322 **** --- 3323,3335 ---- else #endif wlv.char_attr = wlv.extra_attr; + #ifdef FEAT_PROP_POPUP + if (reset_extra_attr) + { + reset_extra_attr = FALSE; + wlv.extra_attr = 0; + } + #endif } #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK) *** ../vim-9.0.0943/src/testdir/test_textprop.vim 2022-11-18 23:13:27.050157746 +0000 --- src/testdir/test_textprop.vim 2022-11-24 22:34:13.736303840 +0000 *************** *** 2690,2701 **** prop_add(1, 0, { type: 'test', text: 'the quick brown fox jumps over the lazy dog', ! text_align: 'after' }) prop_add(1, 0, { ! type: 'test', text: 'the quick brown fox jumps over the lazy dog', ! text_align: 'below' }) normal G$ END --- 2690,2703 ---- prop_add(1, 0, { type: 'test', text: 'the quick brown fox jumps over the lazy dog', ! text_align: 'after', }) + prop_type_add('another', {highlight: 'DiffChange'}) prop_add(1, 0, { ! type: 'another', text: 'the quick brown fox jumps over the lazy dog', ! text_align: 'below', ! text_padding_left: 4, }) normal G$ END *************** *** 2706,2711 **** --- 2708,2716 ---- call term_sendkeys(buf, ":set number\") call VerifyScreenDump(buf, 'Test_prop_with_text_after_below_trunc_2', {}) + call term_sendkeys(buf, ":set cursorline\gg") + call VerifyScreenDump(buf, 'Test_prop_with_text_after_below_trunc_3', {}) + call StopVimInTerminal(buf) endfunc *** ../vim-9.0.0943/src/testdir/dumps/Test_prop_with_text_after_below_trunc_1.dump 2022-08-06 21:03:32.922662885 +0100 --- src/testdir/dumps/Test_prop_with_text_after_below_trunc_1.dump 2022-11-24 22:34:44.320310183 +0000 *************** *** 1,5 **** |o+0&#ffffff0|n|a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d| |f|a|s| |d|f|t+0#e000e06&|h|e| |q|u|i|c|k| |b|r|o|w|n| |f|o|x| |j|u|m|p|s| |o|… ! |t|h|e| |q|u|i|c|k| |b|r|o|w|n| |f|o|x| |j|u|m|p|s| |o|v|e|r| |t|h|e| |l|a|z|y| |d|o|g| +0#0000000&@16 |t|w>o| @56 |~+0#4040ff13&| @58 |~| @58 --- 1,5 ---- |o+0&#ffffff0|n|a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d| |f|a|s| |d|f|t+0#e000e06&|h|e| |q|u|i|c|k| |b|r|o|w|n| |f|o|x| |j|u|m|p|s| |o|… ! | +0#0000000&@3|t+0&#ffd7ff255|h|e| |q|u|i|c|k| |b|r|o|w|n| |f|o|x| |j|u|m|p|s| |o|v|e|r| |t|h|e| |l|a|z|y| |d|o|g| +0&#ffffff0@12 |t|w>o| @56 |~+0#4040ff13&| @58 |~| @58 *** ../vim-9.0.0943/src/testdir/dumps/Test_prop_with_text_after_below_trunc_2.dump 2022-10-10 21:09:40.612547493 +0100 --- src/testdir/dumps/Test_prop_with_text_after_below_trunc_2.dump 2022-11-24 22:34:45.472310423 +0000 *************** *** 1,5 **** | +0#af5f00255#ffffff0@1|1| |o+0#0000000&|n|a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d| |f|a|s| |d|f|t+0#e000e06&|h|e| |q|u|i|c|k| |b|r|o|w|n| |f|o|x| |j|u|m|… ! | +0#af5f00255&@3|t+0#e000e06&|h|e| |q|u|i|c|k| |b|r|o|w|n| |f|o|x| |j|u|m|p|s| |o|v|e|r| |t|h|e| |l|a|z|y| |d|o|g| +0#0000000&@12 | +0#af5f00255&@1|2| |t+0#0000000&|w>o| @52 |~+0#4040ff13&| @58 |~| @58 --- 1,5 ---- | +0#af5f00255#ffffff0@1|1| |o+0#0000000&|n|a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d| |f|a|s| |d|f|t+0#e000e06&|h|e| |q|u|i|c|k| |b|r|o|w|n| |f|o|x| |j|u|m|… ! | +0#af5f00255&@3| +0#0000000&@3|t+0&#ffd7ff255|h|e| |q|u|i|c|k| |b|r|o|w|n| |f|o|x| |j|u|m|p|s| |o|v|e|r| |t|h|e| |l|a|z|y| |d|o|g| +0&#ffffff0@8 | +0#af5f00255&@1|2| |t+0#0000000&|w>o| @52 |~+0#4040ff13&| @58 |~| @58 *** ../vim-9.0.0943/src/testdir/dumps/Test_prop_with_text_after_below_trunc_3.dump 2022-11-24 22:40:22.523821925 +0000 --- src/testdir/dumps/Test_prop_with_text_after_below_trunc_3.dump 2022-11-24 22:36:33.492332793 +0000 *************** *** 0 **** --- 1,8 ---- + | +8#af5f00255#ffffff0@1|1| >o+8#0000000&|n|a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d|f| |a|s|d| |f|a|s| |d|f|t+8#e000e06&|h|e| |q|u|i|c|k| |b|r|o|w|n| |f|o|x| |j|u|m|… + | +8#af5f00255&@3| +8#0000000&@3|t+8&#ffd7ff255|h|e| |q|u|i|c|k| |b|r|o|w|n| |f|o|x| |j|u|m|p|s| |o|v|e|r| |t|h|e| |l|a|z|y| |d|o|g| +8&#ffffff0@8 + | +0#af5f00255&@1|2| |t+0#0000000&|w|o| @52 + |~+0#4040ff13&| @58 + |~| @58 + |~| @58 + |~| @58 + |:+0#0000000&|s|e|t| |c|u|r|s|o|r|l|i|n|e| @26|1|,|1| @10|A|l@1| *** ../vim-9.0.0943/src/version.c 2022-11-24 20:23:20.955119797 +0000 --- src/version.c 2022-11-24 21:47:20.323665941 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 944, /**/ -- Birthdays are healthy. The more you have them, the longer you live. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///