patch 9.1.1789: MS-Windows: using wrong check for bold font

Commit: 
https://github.com/vim/vim/commit/36544c408e9b5a2d7ca480e34936d274df0331cd
Author: Shay <[email protected]>
Date:   Thu Sep 25 05:57:11 2025 +0000

    patch 9.1.1789: MS-Windows: using wrong check for bold font
    
    Problem:  MS-Windows: using wrong check for bold font
              (after v9.1.1347)
    Solution: Test if lf.lfWeight == FW_BOLD instead of a simple truthiness
              test (Shay)
    
    Commit 411ae58 replaced an operator conditional
    
    `if lf.lfWeight == FW_BOLD`
    
    with a truthiness check
    
    `if lf.lfWeight`
    
    This conditional determines whether `:b` is inserted into the value of
    `guifont`. The truthiness check allowed both FW_STANDARD and FW_BOLD
    font weights to trigger the insertion of `:b` into the `guifont` string.
    This commit restores the `== FW_BOLD` condition.
    
    fixes: #18383
    closes: #18397
    
    Signed-off-by: Shay <[email protected]>
    Signed-off-by: Hirohito Higashi <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/gui_w32.c b/src/gui_w32.c
index a29fa91b0..1ee4ab167 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -3719,7 +3719,7 @@ logfont2name(LOGFONTW lf)
            res_size - res_len,
            "%s%s%s%s",
            lf.lfItalic ? ":i" : "",
-           lf.lfWeight ? ":b" : "",
+           lf.lfWeight == FW_BOLD ? ":b" : "",
            lf.lfUnderline ? ":u" : "",
            lf.lfStrikeOut ? ":s" : "");
 
diff --git a/src/version.c b/src/version.c
index bad197898..9531ed0d2 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1789,
 /**/
     1788,
 /**/

-- 
-- 
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/E1v1qxp-00BEPM-VA%40256bit.org.

Raspunde prin e-mail lui