patch 9.1.1123: popup hi groups not falling back to defaults

Commit: 
https://github.com/vim/vim/commit/e700ddeea4a29a724d04ff32b57c327ee55ce065
Author: Yee Cheng Chin <ychin....@gmail.com>
Date:   Thu Feb 20 21:58:21 2025 +0100

    patch 9.1.1123: popup hi groups not falling back to defaults
    
    Problem:  Highlight groups PopupSelected/PopupNotification/
              MessageWindow are supposed to fall back to default highlight
              groups if they are not defined. However, once a colorscheme
              has defined them, switching to another colorscheme that
              doesn't do so will leave behind a cleared colorscheme, which
              causes the fallback to fail.
    
    Solution: Set up default links to the relevant fallback highlight
              groups, which makes sure a `:hi clear` command will reset the
              state properly (Yee Cheng Chin).
    
    closes: #16676
    
    Signed-off-by: Yee Cheng Chin <ychin....@gmail.com>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/doc/popup.txt b/runtime/doc/popup.txt
index 06acf3918..ba87b31f1 100644
--- a/runtime/doc/popup.txt
+++ b/runtime/doc/popup.txt
@@ -1,4 +1,4 @@
-*popup.txt*  For Vim version 9.1.  Last change: 2025 Jan 08
+*popup.txt*  For Vim version 9.1.  Last change: 2025 Feb 20
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -504,7 +504,7 @@ popup_menu({what}, {options})                               
 *popup_menu()*
                                \ mapping: 0,
                                \ })
 <              The current line is highlighted with a match using
-               "PopupSelected", or "PmenuSel" if that is not defined.
+               |hl-PopupSelected| which is linked to "PmenuSel" by default.
 
                Use {options} to change the properties.  Should at least set
                "callback" to a function that handles the selected item.
@@ -559,7 +559,7 @@ popup_notification({what}, {options})                       
 *popup_notification()*
                                \ close: 'click',
                                \ padding: [0,1,0,1],
                                \ })
-<              The PopupNotification highlight group is used instead of
+<              The |hl-PopupNotification| highlight group is used instead of
                WarningMsg if it is defined.
 
                Without the |+timers| feature the popup will not disappear
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 38f764f7a..cb6704cd3 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt*   For Vim version 9.1.  Last change: 2025 Jan 20
+*syntax.txt*   For Vim version 9.1.  Last change: 2025 Feb 20
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -5831,8 +5831,8 @@ CursorLineSign    Like SignColumn when 'cursorline' is 
set for the cursor line.
 MatchParen     Character under the cursor or just before it, if it
                is a paired bracket, and its match. |pi_paren.txt|
                                                        *hl-MessageWindow*
-MessageWindow  Messages popup window used by `:echowindow`.  If not defined
-               |hl-WarningMsg| is used.
+MessageWindow  Messages popup window used by `:echowindow`.  Linked to
+               |hl-WarningMsg| by default.
                                                        *hl-ModeMsg*
 ModeMsg                'showmode' message (e.g., "-- INSERT --").
                                                        *hl-MsgArea*
@@ -5872,10 +5872,13 @@ PmenuMatchSel   Popup menu: Matched text in selected 
item. Applied in
                combination with |hl-PmenuSel|.
                                                        *hl-ComplMatchIns*
 ComplMatchIns  Matched text of the currently inserted completion.
+                                                       *hl-PopupSelected*
+PopupSelected  Popup window created with |popup_menu()|.  Linked to
+               |hl-PmenuSel| by default.
                                                        *hl-PopupNotification*
 PopupNotification
-               Popup window created with |popup_notification()|.  If not
-               defined |hl-WarningMsg| is used.
+               Popup window created with |popup_notification()|.  Linked to
+               |hl-WarningMsg| by default.
                                                        *hl-Question*
 Question       |hit-enter| prompt and yes/no questions.
                                                        *hl-QuickFixLine*
diff --git a/runtime/doc/tags b/runtime/doc/tags
index eb9c48c21..aa43fb0ed 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -8191,6 +8191,7 @@ hl-PmenuSbar      syntax.txt      /*hl-PmenuSbar*
 hl-PmenuSel    syntax.txt      /*hl-PmenuSel*
 hl-PmenuThumb  syntax.txt      /*hl-PmenuThumb*
 hl-PopupNotification   syntax.txt      /*hl-PopupNotification*
+hl-PopupSelected       syntax.txt      /*hl-PopupSelected*
 hl-Question    syntax.txt      /*hl-Question*
 hl-QuickFixLine        syntax.txt      /*hl-QuickFixLine*
 hl-Scrollbar   syntax.txt      /*hl-Scrollbar*
diff --git a/src/highlight.c b/src/highlight.c
index 1a4c76d94..8c1ad8049 100644
--- a/src/highlight.c
+++ b/src/highlight.c
@@ -262,6 +262,9 @@ static char *(highlight_init_both[]) = {
     "default link PmenuMatchSel PmenuSel",
     "default link PmenuExtra Pmenu",
     "default link PmenuExtraSel PmenuSel",
+    "default link PopupSelected PmenuSel",
+    "default link MessageWindow WarningMsg",
+    "default link PopupNotification WarningMsg",
     CENT("Normal cterm=NONE", "Normal gui=NONE"),
     NULL
 };
diff --git a/src/popupwin.c b/src/popupwin.c
index 404549097..c84c079d3 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -696,9 +696,6 @@ popup_highlight_curline(win_T *wp)
        if (!sign_exists_by_name(sign_name))
        {
            char *linehl = "PopupSelected";
-
-           if (syn_name2id((char_u *)linehl) == 0)
-               linehl = "PmenuSel";
            sign_define_by_name(sign_name, NULL, (char_u *)linehl, NULL, NULL, 
NULL,
                    NULL, SIGN_DEF_PRIO);
        }
@@ -2006,10 +2003,8 @@ popup_update_color(win_T *wp, create_type_T type)
 {
     char    *hiname = type == TYPE_MESSAGE_WIN
                                       ? "MessageWindow" : "PopupNotification";
-    int                nr = syn_name2id((char_u *)hiname);
-
     set_string_option_direct_in_win(wp, (char_u *)"wincolor", -1,
-               (char_u *)(nr == 0 ? "WarningMsg" : hiname),
+               (char_u *)hiname,
                OPT_FREE|OPT_LOCAL, 0);
 }
 
diff --git a/src/testdir/dumps/Test_popupwin_notify_02.dump 
b/src/testdir/dumps/Test_popupwin_notify_02.dump
index 72e2895f1..e25efdc63 100644
--- a/src/testdir/dumps/Test_popupwin_notify_02.dump
+++ b/src/testdir/dumps/Test_popupwin_notify_02.dump
@@ -1,6 +1,6 @@
->1+0&#ffffff0| @7|╔+0#e000002&|═@21|╗| +0#0000000&@41
-|2| @7|║+0#e000002&| |f|i|r|s|t| |n|o|t|i|f|i|c|a|t|i|o|n| @2|║| +0#0000000&@41
-|3| @7|╚+0#e000002&|═@21|╝| +0#0000000&@41
+>1+0&#ffffff0| @7|╔+0&#5fd7ff255|═@21|╗| +0&#ffffff0@41
+|2| @7|║+0&#5fd7ff255| |f|i|r|s|t| |n|o|t|i|f|i|c|a|t|i|o|n| @2|║| 
+0&#ffffff0@41
+|3| @7|╚+0&#5fd7ff255|═@21|╝| +0&#ffffff0@41
 |4| @7|╔+0&#5fd7ff255|═@31|╗| +0&#ffffff0@31
 |5| @7|║+0&#5fd7ff255| |a|n|o|t|h|e|r| |i|m|p|o|r|t|a|n|t| 
|n|o|t|i|f|i|c|a|t|i|o|n| |║| +0&#ffffff0@31
 |6| @7|╚+0&#5fd7ff255|═@31|╝| +0&#ffffff0@31
diff --git a/src/version.c b/src/version.c
index f400ca9e6..0e7e236ea 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1123,
 /**/
     1122,
 /**/

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1tlDsu-003AJ3-Ni%40256bit.org.

Raspunde prin e-mail lui