Patch 9.0.0661
Problem: Multi-byte "lastline" item in 'fillchars' does not work properly
when the window is two columns wide.
Solution: Compute the text length correctly. (closes #11280)
Files: src/drawscreen.c, src/testdir/test_display.vim,
src/testdir/dumps/Test_display_lastline_6.dump,
src/testdir/dumps/Test_display_lastline_euro_6.dump
*** ../vim-9.0.0660/src/drawscreen.c 2022-10-04 16:23:39.010042185 +0100
--- src/drawscreen.c 2022-10-04 20:30:57.268952668 +0100
***************
*** 2643,2657 ****
{
int scr_row = W_WINROW(wp) + wp->w_height - 1;
int symbol = wp->w_fill_chars.lastline;
! int len;
char_u fillbuf[12]; // 2 characters of 6 bytes
! len = mb_char2bytes(symbol, &fillbuf[0]);
! len += mb_char2bytes(symbol, &fillbuf[len]);
// Last line isn't finished: Display "@@@" in the last screen line.
screen_puts_len(fillbuf,
! wp->w_width > 2 ? len : wp->w_width,
scr_row, wp->w_wincol, HL_ATTR(HLF_AT));
screen_fill(scr_row, scr_row + 1,
(int)wp->w_wincol + 2, (int)W_ENDCOL(wp),
--- 2643,2657 ----
{
int scr_row = W_WINROW(wp) + wp->w_height - 1;
int symbol = wp->w_fill_chars.lastline;
! int charlen;
char_u fillbuf[12]; // 2 characters of 6 bytes
! charlen = mb_char2bytes(symbol, &fillbuf[0]);
! mb_char2bytes(symbol, &fillbuf[charlen]);
// Last line isn't finished: Display "@@@" in the last screen line.
screen_puts_len(fillbuf,
! (wp->w_width > 2 ? 2 : wp->w_width) * charlen,
scr_row, wp->w_wincol, HL_ATTR(HLF_AT));
screen_fill(scr_row, scr_row + 1,
(int)wp->w_wincol + 2, (int)W_ENDCOL(wp),
*** ../vim-9.0.0660/src/testdir/test_display.vim 2022-10-04
14:34:42.116964799 +0100
--- src/testdir/test_display.vim 2022-10-04 20:30:57.272952634 +0100
***************
*** 419,424 ****
--- 419,428 ----
call term_sendkeys(buf, ":3split\<CR>")
call VerifyScreenDump(buf, $'Test_display_lastline_{a:euro}5', {})
+ call term_sendkeys(buf, ":close\<CR>")
+ call term_sendkeys(buf, ":2vsplit\<CR>")
+ call VerifyScreenDump(buf, $'Test_display_lastline_{a:euro}6', {})
+
call StopVimInTerminal(buf)
endfunc
*** ../vim-9.0.0660/src/testdir/dumps/Test_display_lastline_6.dump
2022-10-04 20:34:20.187457253 +0100
--- src/testdir/dumps/Test_display_lastline_6.dump 2022-10-04
20:30:57.268952668 +0100
***************
*** 0 ****
--- 1,10 ----
+ >a+0&#ffffff0@1||+1&&|a+0&&@2| @68
+ |a| ||+1&&|b+0&&@71
+ @2||+1&&|b+0&&@71
+ @2||+1&&|b+0&&@55| @15
+ |b@1||+1&&|~+0#4040ff13&| @70
+ |b+0#0000000&@1||+1&&|~+0#4040ff13&| @70
+ |b+0#0000000&@1||+1&&|~+0#4040ff13&| @70
+ |@@1||+1#0000000&|~+0#4040ff13&| @70
+ |<+3#0000000&|1| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @40|1|,|1| @11|A|l@1
+ |:+0&&|2|v|s|p|l|i|t| @66
*** ../vim-9.0.0660/src/testdir/dumps/Test_display_lastline_euro_6.dump
2022-10-04 20:34:20.191457226 +0100
--- src/testdir/dumps/Test_display_lastline_euro_6.dump 2022-10-04
20:30:57.268952668 +0100
***************
*** 0 ****
--- 1,10 ----
+ >a+0&#ffffff0@1||+1&&|a+0&&@2| @68
+ |a| ||+1&&|b+0&&@71
+ @2||+1&&|b+0&&@71
+ @2||+1&&|b+0&&@55| @15
+ |b@1||+1&&|~+0#4040ff13&| @70
+ |b+0#0000000&@1||+1&&|~+0#4040ff13&| @70
+ |b+0#0000000&@1||+1&&|~+0#4040ff13&| @70
+ |€@1||+1#0000000&|~+0#4040ff13&| @70
+ |<+3#0000000&|1| |[+1&&|N|o| |N|a|m|e|]| |[|+|]| @40|1|,|1| @11|A|l@1
+ |:+0&&|2|v|s|p|l|i|t| @66
*** ../vim-9.0.0660/src/version.c 2022-10-04 20:14:23.461997287 +0100
--- src/version.c 2022-10-04 20:34:05.123558467 +0100
***************
*** 701,702 ****
--- 701,704 ----
{ /* Add new patch number below this line */
+ /**/
+ 661,
/**/
--
A cow comes flying over the battlements, lowing aggressively. The cow
lands on GALAHAD'S PAGE, squashing him completely.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20221004193604.DCEAF1C09A3%40moolenaar.net.