comparison 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
comparison
equal deleted inserted replaced
29472:1a227a808854 29473:1c688281673d
1407 } 1407 }
1408 1408
1409 # ifdef FEAT_X11 1409 # ifdef FEAT_X11
1410 // If we were yanking to the '+' register, send result to selection. 1410 // If we were yanking to the '+' register, send result to selection.
1411 // Also copy to the '*' register, in case auto-select is off. But not when 1411 // Also copy to the '*' register, in case auto-select is off. But not when
1412 // 'clipboard' has "unnamedplus" and not "unnamed". 1412 // 'clipboard' has "unnamedplus" and not "unnamed"; and not when
1413 // deleting and both "unnamedplus" and "unnamed".
1413 if (clip_plus.available 1414 if (clip_plus.available
1414 && (curr == &(y_regs[PLUS_REGISTER]) 1415 && (curr == &(y_regs[PLUS_REGISTER])
1415 || (!deleting && oap->regname == 0 1416 || (!deleting && oap->regname == 0
1416 && ((clip_unnamed | clip_unnamed_saved) & 1417 && ((clip_unnamed | clip_unnamed_saved) &
1417 CLIP_UNNAMED_PLUS)))) 1418 CLIP_UNNAMED_PLUS))))
1423 clip_own_selection(&clip_plus); 1424 clip_own_selection(&clip_plus);
1424 clip_gen_set_selection(&clip_plus); 1425 clip_gen_set_selection(&clip_plus);
1425 if (!clip_isautosel_star() 1426 if (!clip_isautosel_star()
1426 && !clip_isautosel_plus() 1427 && !clip_isautosel_plus()
1427 && !((clip_unnamed | clip_unnamed_saved) == CLIP_UNNAMED_PLUS) 1428 && !((clip_unnamed | clip_unnamed_saved) == CLIP_UNNAMED_PLUS)
1429 && !(deleting && (clip_unnamed | clip_unnamed_saved)
1430 == (CLIP_UNNAMED | CLIP_UNNAMED_PLUS))
1428 && !did_star 1431 && !did_star
1429 && curr == &(y_regs[PLUS_REGISTER])) 1432 && curr == &(y_regs[PLUS_REGISTER]))
1430 { 1433 {
1431 copy_yank_reg(&(y_regs[STAR_REGISTER])); 1434 copy_yank_reg(&(y_regs[STAR_REGISTER]));
1432 clip_own_selection(&clip_star); 1435 clip_own_selection(&clip_star);