Commit: patch 9.2.0918: screen: fill char with a zero low byte is stored as a NUL cell

Christian Brabandt <[email protected]> Thu, 6 Aug 2026 21:30:05 +0200
Newsgroups gmane.editors.vim.devel
Message-ID <[email protected]>
patch 9.2.0918: screen: fill char with a zero low byte is stored as a NUL cell

Commit: https://github.com/vim/vim/commit/1ae09867ff36a85b0328d43fb5672067fb5b3409
Author: Hirohito Higashi <[email protected]>
Date:   Thu Aug 6 19:23:04 2026 +0000

    patch 9.2.0918: screen: fill char with a zero low byte is stored as a NUL cell
    
    Problem:  Using a multibyte fill character whose lower byte is zero, such
              as U+2500 for a popup border or 'fillchars', stores a NUL in
              ScreenLines[].  That marks the cell as the right half of a
              double-width character, and the GUI reports E340 when the window
              is resized (iranoan).
    Solution: Store 0x80 instead of the truncated character code, like
              fold_line() already does (Hirohito Higashi)
    
    related: vim-jp/issues#1460
    closes:  #20960
    
    Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
    Signed-off-by: Hirohito Higashi <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/screen.c b/src/screen.c
index 07a237b0c..201238c94 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -1233,6 +1233,7 @@ skip_opacity:
 			{
 			    ScreenLinesUC[off_to] = c;
 			    ScreenLinesC[0][off_to] = 0;
+			    ScreenLines[off_to] = 0x80; // avoid storing zero
 			}
 			else
 			    ScreenLinesUC[off_to] = 0;
@@ -3081,6 +3082,7 @@ skip_opacity_fill:
 		    {
 			ScreenLinesUC[off] = c;
 			ScreenLinesC[0][off] = 0;
+			ScreenLines[off] = 0x80; // avoid storing zero
 		    }
 		    else
 			ScreenLinesUC[off] = 0;
diff --git a/src/version.c b/src/version.c
index 5be07d868..749988b25 100644
--- a/src/version.c
+++ b/src/version.c
@@ -763,6 +763,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    918,
 /**/
     917,
 /**/

-- 
-- 
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 visit https://groups.google.com/d/msgid/vim_dev/E1ws3n3-00GVkD-Ai%40256bit.org.