Mercurial > vim
diff src/register.c @ 29473:1c688281673d v9.0.0078
patch 9.0.0078: star register is unexpectedly changed when deleting
Commit: https://github.com/vim/vim/commit/559f230fd618e51d7986d87217ff38a2eac73cef
Author: Ernie Rael <errael@raelity.com>
Date: Tue Jul 26 14:44:36 2022 +0100
patch 9.0.0078: star register is unexpectedly changed when deleting
Problem: Star register is changed when deleting and both "unnamed" and
"unnamedplus" are in 'clipboard'.
Solution: Make the use of the star register work as documented. (Ernie Rael,
closes #10669)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 26 Jul 2022 15:45:03 +0200 |
parents | 057c26b5c33a |
children | 8a243ecfe2dd |
line wrap: on
line diff
--- a/src/register.c +++ b/src/register.c @@ -1409,7 +1409,8 @@ 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. But not when - // 'clipboard' has "unnamedplus" and not "unnamed". + // 'clipboard' has "unnamedplus" and not "unnamed"; and not when + // deleting and both "unnamedplus" and "unnamed". if (clip_plus.available && (curr == &(y_regs[PLUS_REGISTER]) || (!deleting && oap->regname == 0 @@ -1425,6 +1426,8 @@ op_yank(oparg_T *oap, int deleting, int if (!clip_isautosel_star() && !clip_isautosel_plus() && !((clip_unnamed | clip_unnamed_saved) == CLIP_UNNAMED_PLUS) + && !(deleting && (clip_unnamed | clip_unnamed_saved) + == (CLIP_UNNAMED | CLIP_UNNAMED_PLUS)) && !did_star && curr == &(y_regs[PLUS_REGISTER])) {