changeset 24041:580ee78577e9 v8.2.2562

patch 8.2.2562: GUI: star register changed when 'clipboard is "unnamedplus" Commit: https://github.com/vim/vim/commit/37096afd3f3133a831ab49a9677f090c3c935c9d Author: Bram Moolenaar <Bram@vim.org> Date: Tue Mar 2 19:04:11 2021 +0100 patch 8.2.2562: GUI: star register changed when 'clipboard is "unnamedplus" Problem: GUI: star register changed when 'clipboard is "unnamedplus". (Ingo Karkat) Solution: Do not change the star register when 'clipboard' contains "unnamedplus" and not "unnamed". (closes #1516)
author Bram Moolenaar <Bram@vim.org>
date Tue, 02 Mar 2021 19:15:03 +0100
parents 8ab44908fad4
children 553271829e46
files src/register.c src/version.c
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/register.c
+++ b/src/register.c
@@ -1402,12 +1402,13 @@ op_yank(oparg_T *oap, int deleting, int 
 
 # ifdef FEAT_X11
     // If we were yanking to the '+' register, send result to selection.
-    // Also copy to the '*' register, in case auto-select is off.
+    // Also copy to the '*' register, in case auto-select is off.  But not when
+    // 'clipboard' has "unnamedplus" and not "unnamed".
     if (clip_plus.available
 	    && (curr == &(y_regs[PLUS_REGISTER])
 		|| (!deleting && oap->regname == 0
 		  && ((clip_unnamed | clip_unnamed_saved) &
-		      CLIP_UNNAMED_PLUS))))
+							  CLIP_UNNAMED_PLUS))))
     {
 	if (curr != &(y_regs[PLUS_REGISTER]))
 	    // Copy the text from register 0 to the clipboard register.
@@ -1415,8 +1416,11 @@ op_yank(oparg_T *oap, int deleting, int 
 
 	clip_own_selection(&clip_plus);
 	clip_gen_set_selection(&clip_plus);
-	if (!clip_isautosel_star() && !clip_isautosel_plus()
-		&& !did_star && curr == &(y_regs[PLUS_REGISTER]))
+	if (!clip_isautosel_star()
+		&& !clip_isautosel_plus()
+		&& !((clip_unnamed | clip_unnamed_saved) == CLIP_UNNAMED_PLUS)
+		&& !did_star
+		&& curr == &(y_regs[PLUS_REGISTER]))
 	{
 	    copy_yank_reg(&(y_regs[STAR_REGISTER]));
 	    clip_own_selection(&clip_star);
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2562,
+/**/
     2561,
 /**/
     2560,