To: vim_dev@googlegroups.com Subject: Patch 9.0.0442 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0442 Problem: Virtual text "above" doesn't handel line numbers. Solution: Take the left column offset into account. (issue #11084) Also make padding work. Files: src/drawline.c, src/testdir/test_textprop.vim, src/testdir/dumps/Test_prop_with_text_above_1.dump, src/testdir/dumps/Test_prop_with_text_above_2.dump, src/testdir/dumps/Test_prop_with_text_above_3.dump, src/testdir/dumps/Test_prop_with_text_above_4.dump *** ../vim-9.0.0441/src/drawline.c 2022-09-10 20:00:31.121468657 +0100 --- src/drawline.c 2022-09-11 13:25:13.001778185 +0100 *************** *** 350,356 **** if (above) { before = 0; ! after = wp->w_width - cells; } else { --- 350,356 ---- if (above) { before = 0; ! after = wp->w_width - cells - win_col_off(wp) - padding; } else { *************** *** 436,441 **** --- 436,443 ---- *p_extra = l; *n_extra = n_used + before + after + padding; *n_attr = mb_charlen(*p_extra); + if (above) + *n_attr -= padding; *n_attr_skip = before + padding + col_off; } } *************** *** 1858,1865 **** dont_use_showbreak = TRUE; } #endif ! if ((right || above || below || !wrap || padding > 0) ! && wp->w_width > 2) { char_u *prev_p_extra = wlv.p_extra; int start_line; --- 1860,1867 ---- dont_use_showbreak = TRUE; } #endif ! if ((right || above || below || !wrap ! || padding > 0) && wp->w_width > 2) { char_u *prev_p_extra = wlv.p_extra; int start_line; *** ../vim-9.0.0441/src/testdir/test_textprop.vim 2022-09-10 22:31:45.962395605 +0100 --- src/testdir/test_textprop.vim 2022-09-11 13:20:07.938491225 +0100 *************** *** 2857,2863 **** call prop_type_add('above2', #{highlight: 'DiffChange'}) call prop_add(1, 0, #{type: 'above1', text: 'first thing above', text_align: 'above'}) call prop_add(1, 0, #{type: 'above2', text: 'second thing above', text_align: 'above'}) ! call prop_add(3, 0, #{type: 'above1', text: 'another thing', text_align: 'above'}) normal gglllj END --- 2857,2863 ---- call prop_type_add('above2', #{highlight: 'DiffChange'}) call prop_add(1, 0, #{type: 'above1', text: 'first thing above', text_align: 'above'}) call prop_add(1, 0, #{type: 'above2', text: 'second thing above', text_align: 'above'}) ! call prop_add(3, 0, #{type: 'above1', text: 'another thing', text_align: 'above', text_padding_left: 3}) normal gglllj END *************** *** 2870,2875 **** --- 2870,2878 ---- call term_sendkeys(buf, "inserted \") call VerifyScreenDump(buf, 'Test_prop_with_text_above_3', {}) + call term_sendkeys(buf, ":set number signcolumn=yes\") + call VerifyScreenDump(buf, 'Test_prop_with_text_above_4', {}) + call StopVimInTerminal(buf) endfunc *** ../vim-9.0.0441/src/testdir/dumps/Test_prop_with_text_above_1.dump 2022-09-10 20:00:31.121468657 +0100 --- src/testdir/dumps/Test_prop_with_text_above_1.dump 2022-09-11 13:25:18.397765687 +0100 *************** *** 2,8 **** |s+0&#ffd7ff255|e|c|o|n|d| |t|h|i|n|g| |a|b|o|v|e| @41 |o+0&#ffffff0|n|e| |t|w|o| @52 |t|h|r>e@1| |f|o|u|r| @49 ! |a+0&#ffff4012|n|o|t|h|e|r| |t|h|i|n|g| @46 |f+0&#ffffff0|i|v|e| |s|i|x| @51 |~+0#4040ff13&| @58 |~| @58 --- 2,8 ---- |s+0&#ffd7ff255|e|c|o|n|d| |t|h|i|n|g| |a|b|o|v|e| @41 |o+0&#ffffff0|n|e| |t|w|o| @52 |t|h|r>e@1| |f|o|u|r| @49 ! @3|a+0&#ffff4012|n|o|t|h|e|r| |t|h|i|n|g| @43 |f+0&#ffffff0|i|v|e| |s|i|x| @51 |~+0#4040ff13&| @58 |~| @58 *** ../vim-9.0.0441/src/testdir/dumps/Test_prop_with_text_above_2.dump 2022-09-10 22:31:45.962395605 +0100 --- src/testdir/dumps/Test_prop_with_text_above_2.dump 2022-09-11 13:25:19.461763224 +0100 *************** *** 2,8 **** |s+0&#ffd7ff255|e|c|o|n|d| |t|h|i|n|g| |a|b|o|v|e| @41 >o+0&#ffffff0|n|e| |t|w|o| @52 |t|h|r|e@1| |f|o|u|r| @49 ! |a+0&#ffff4012|n|o|t|h|e|r| |t|h|i|n|g| @46 |f+0&#ffffff0|i|v|e| |s|i|x| @51 |~+0#4040ff13&| @58 |~| @58 --- 2,8 ---- |s+0&#ffd7ff255|e|c|o|n|d| |t|h|i|n|g| |a|b|o|v|e| @41 >o+0&#ffffff0|n|e| |t|w|o| @52 |t|h|r|e@1| |f|o|u|r| @49 ! @3|a+0&#ffff4012|n|o|t|h|e|r| |t|h|i|n|g| @43 |f+0&#ffffff0|i|v|e| |s|i|x| @51 |~+0#4040ff13&| @58 |~| @58 *** ../vim-9.0.0441/src/testdir/dumps/Test_prop_with_text_above_3.dump 2022-09-10 22:31:45.962395605 +0100 --- src/testdir/dumps/Test_prop_with_text_above_3.dump 2022-09-11 13:25:20.525760759 +0100 *************** *** 2,8 **** |s+0&#ffd7ff255|e|c|o|n|d| |t|h|i|n|g| |a|b|o|v|e| @41 |i+0&#ffffff0|n|s|e|r|t|e|d> |o|n|e| |t|w|o| @43 |t|h|r|e@1| |f|o|u|r| @49 ! |a+0&#ffff4012|n|o|t|h|e|r| |t|h|i|n|g| @46 |f+0&#ffffff0|i|v|e| |s|i|x| @51 |~+0#4040ff13&| @58 |~| @58 --- 2,8 ---- |s+0&#ffd7ff255|e|c|o|n|d| |t|h|i|n|g| |a|b|o|v|e| @41 |i+0&#ffffff0|n|s|e|r|t|e|d> |o|n|e| |t|w|o| @43 |t|h|r|e@1| |f|o|u|r| @49 ! @3|a+0&#ffff4012|n|o|t|h|e|r| |t|h|i|n|g| @43 |f+0&#ffffff0|i|v|e| |s|i|x| @51 |~+0#4040ff13&| @58 |~| @58 *** ../vim-9.0.0441/src/testdir/dumps/Test_prop_with_text_above_4.dump 2022-09-11 13:30:02.945596176 +0100 --- src/testdir/dumps/Test_prop_with_text_above_4.dump 2022-09-11 13:25:21.593758289 +0100 *************** *** 0 **** --- 1,9 ---- + | +0#0000e05#a8a8a8255@1| +0#af5f00255#ffffff0@1|1| |f+0#0000000#ffff4012|i|r|s|t| |t|h|i|n|g| |a|b|o|v|e| @36 + | +0#0000e05#a8a8a8255@1| +0#af5f00255#ffffff0@3|s+0#0000000#ffd7ff255|e|c|o|n|d| |t|h|i|n|g| |a|b|o|v|e| @35 + | +0#0000e05#a8a8a8255@1| +0#af5f00255#ffffff0@3|i+0#0000000&|n|s|e|r|t|e|d> |o|n|e| |t|w|o| @37 + | +0#0000e05#a8a8a8255@1| +0#af5f00255#ffffff0@1|2| |t+0#0000000&|h|r|e@1| |f|o|u|r| @43 + | +0#0000e05#a8a8a8255@1| +0#af5f00255#ffffff0@1|3| | +0#0000000&@2|a+0&#ffff4012|n|o|t|h|e|r| |t|h|i|n|g| @37 + | +0#0000e05#a8a8a8255@1| +0#af5f00255#ffffff0@3|f+0#0000000&|i|v|e| |s|i|x| @45 + |~+0#4040ff13&| @58 + |~| @58 + | +0#0000000&@41|1|,|9|-|1@1|7| @6|A|l@1| *** ../vim-9.0.0441/src/version.c 2022-09-11 12:01:01.049365323 +0100 --- src/version.c 2022-09-11 13:15:30.871154797 +0100 *************** *** 705,706 **** --- 705,708 ---- { /* Add new patch number below this line */ + /**/ + 442, /**/ -- Latest survey shows that 3 out of 4 people make up 75% of the world's population. /// 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 ///