Skip to content

Commit 37096af

Browse files
committed
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)
1 parent 3dc3474 commit 37096af

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

src/register.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,21 +1402,25 @@ op_yank(oparg_T *oap, int deleting, int mess)
14021402

14031403
# ifdef FEAT_X11
14041404
// If we were yanking to the '+' register, send result to selection.
1405-
// Also copy to the '*' register, in case auto-select is off.
1405+
// Also copy to the '*' register, in case auto-select is off. But not when
1406+
// 'clipboard' has "unnamedplus" and not "unnamed".
14061407
if (clip_plus.available
14071408
&& (curr == &(y_regs[PLUS_REGISTER])
14081409
|| (!deleting && oap->regname == 0
14091410
&& ((clip_unnamed | clip_unnamed_saved) &
1410-
CLIP_UNNAMED_PLUS))))
1411+
CLIP_UNNAMED_PLUS))))
14111412
{
14121413
if (curr != &(y_regs[PLUS_REGISTER]))
14131414
// Copy the text from register 0 to the clipboard register.
14141415
copy_yank_reg(&(y_regs[PLUS_REGISTER]));
14151416

14161417
clip_own_selection(&clip_plus);
14171418
clip_gen_set_selection(&clip_plus);
1418-
if (!clip_isautosel_star() && !clip_isautosel_plus()
1419-
&& !did_star && curr == &(y_regs[PLUS_REGISTER]))
1419+
if (!clip_isautosel_star()
1420+
&& !clip_isautosel_plus()
1421+
&& !((clip_unnamed | clip_unnamed_saved) == CLIP_UNNAMED_PLUS)
1422+
&& !did_star
1423+
&& curr == &(y_regs[PLUS_REGISTER]))
14201424
{
14211425
copy_yank_reg(&(y_regs[STAR_REGISTER]));
14221426
clip_own_selection(&clip_star);

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2562,
753755
/**/
754756
2561,
755757
/**/

0 commit comments

Comments
 (0)