patch 9.2.0218: visual selection highlighting in X11 GUI is wrong.

Commit: 
https://github.com/vim/vim/commit/60edf94c4e6b1c6359c52b45278c24ed709a8273
Author: Shane Harper <[email protected]>
Date:   Fri Mar 20 23:12:33 2026 +0000

    patch 9.2.0218: visual selection highlighting in X11 GUI is wrong.
    
    Problem:  The check for whether an X connection was opened was incorrect
              (after v9.2.0158).
    Solution: Use X_DISPLAY instead of xterm_dpy (Shane Harper)
    
    Note: xterm_dpy would be NULL if Vim was started in GUI mode.
    
    Previously, starting two instances of gvim that use GTK3 with:
    GDK_BACKEND=x11 gvim and making a visual selection in both would leave
    both selections highlighted with the Visual highlight group. Now, when
    the second selection is made the first selection will be highlighted
    with VisualNOS.
    
    closes: #19752
    
    Signed-off-by: Shane Harper <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/drawline.c b/src/drawline.c
index b4366c794..b7910832b 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -1462,10 +1462,7 @@ win_line(
                area_highlighting = TRUE;
                vi_attr = HL_ATTR(HLF_V);
 #if defined(FEAT_CLIPBOARD) && defined(FEAT_X11)
-               if (
-# ifdef FEAT_XCLIPBOARD
-                       xterm_dpy &&
-# endif
+               if (X_DISPLAY &&
                        ((clip_star.available && !clip_star.owned
                                                    && clip_isautosel_star())
                            || (clip_plus.available && !clip_plus.owned
diff --git a/src/version.c b/src/version.c
index d1bae5a5b..db107b529 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    218,
 /**/
     217,
 /**/
diff --git a/src/vim.h b/src/vim.h
index 63cb78088..f2e3a1610 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -2683,16 +2683,16 @@ typedef int (*opt_expand_cb_T)(optexpand_T *args, int 
*numMatches, char_u ***mat
 # else
 #  define X_DISPLAY    (gui.in_use ? gui.dpy : xterm_dpy)
 # endif
-#else
-# ifdef FEAT_GUI
-#  ifdef FEAT_GUI_GTK
-#   define X_DISPLAY   ((gui.in_use) ? gui_mch_get_display() : (Display *)NULL)
-#  else
-#   define X_DISPLAY   gui.dpy
-#  endif
+#elif defined(FEAT_GUI)
+# ifdef FEAT_GUI_GTK
+#  define X_DISPLAY    ((gui.in_use) ? gui_mch_get_display() : (Display *)NULL)
 # else
-#  define X_DISPLAY    xterm_dpy
+#  define X_DISPLAY    gui.dpy
 # endif
+#elif defined(FEAT_XCLIPBOARD)
+# define X_DISPLAY     xterm_dpy
+#else
+# define X_DISPLAY     (Display *)NULL
 #endif
 
 #ifdef FEAT_GUI_GTK

-- 
-- 
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/E1w3jI4-00FRun-2j%40256bit.org.

Raspunde prin e-mail lui