Mercurial > vim
comparison src/ops.c @ 6116:7766142fc7d3 v7.4.396
updated for version 7.4.396
Problem: When 'clipboard' is "unnamed", :g/pat/d is very slow. (Praful)
Solution: Only set the clipboard after the last delete. (Christian Brabandt)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 06 Aug 2014 18:17:11 +0200 |
parents | ef83b423ebf7 |
children | cb3218a69c2f |
comparison
equal
deleted
inserted
replaced
6115:fe7b9f6ad226 | 6116:7766142fc7d3 |
---|---|
1595 adjust_clip_reg(rp) | 1595 adjust_clip_reg(rp) |
1596 int *rp; | 1596 int *rp; |
1597 { | 1597 { |
1598 /* If no reg. specified, and "unnamed" or "unnamedplus" is in 'clipboard', | 1598 /* If no reg. specified, and "unnamed" or "unnamedplus" is in 'clipboard', |
1599 * use '*' or '+' reg, respectively. "unnamedplus" prevails. */ | 1599 * use '*' or '+' reg, respectively. "unnamedplus" prevails. */ |
1600 if (*rp == 0 && clip_unnamed != 0) | 1600 if (*rp == 0 && (clip_unnamed != 0 || clip_unnamed_saved != 0)) |
1601 *rp = ((clip_unnamed & CLIP_UNNAMED_PLUS) && clip_plus.available) | 1601 { |
1602 if (clip_unnamed != 0) | |
1603 *rp = ((clip_unnamed & CLIP_UNNAMED_PLUS) && clip_plus.available) | |
1602 ? '+' : '*'; | 1604 ? '+' : '*'; |
1605 else | |
1606 *rp = ((clip_unnamed_saved & CLIP_UNNAMED_PLUS) && clip_plus.available) | |
1607 ? '+' : '*'; | |
1608 } | |
1603 if (!clip_star.available && *rp == '*') | 1609 if (!clip_star.available && *rp == '*') |
1604 *rp = 0; | 1610 *rp = 0; |
1605 if (!clip_plus.available && *rp == '+') | 1611 if (!clip_plus.available && *rp == '+') |
1606 *rp = 0; | 1612 *rp = 0; |
1607 } | 1613 } |
3201 * to the '*' register. | 3207 * to the '*' register. |
3202 */ | 3208 */ |
3203 if (clip_star.available | 3209 if (clip_star.available |
3204 && (curr == &(y_regs[STAR_REGISTER]) | 3210 && (curr == &(y_regs[STAR_REGISTER]) |
3205 || (!deleting && oap->regname == 0 | 3211 || (!deleting && oap->regname == 0 |
3206 && (clip_unnamed & CLIP_UNNAMED)))) | 3212 && ((clip_unnamed | clip_unnamed_saved) & CLIP_UNNAMED)))) |
3207 { | 3213 { |
3208 if (curr != &(y_regs[STAR_REGISTER])) | 3214 if (curr != &(y_regs[STAR_REGISTER])) |
3209 /* Copy the text from register 0 to the clipboard register. */ | 3215 /* Copy the text from register 0 to the clipboard register. */ |
3210 copy_yank_reg(&(y_regs[STAR_REGISTER])); | 3216 copy_yank_reg(&(y_regs[STAR_REGISTER])); |
3211 | 3217 |
3222 * Also copy to the '*' register, in case auto-select is off. | 3228 * Also copy to the '*' register, in case auto-select is off. |
3223 */ | 3229 */ |
3224 if (clip_plus.available | 3230 if (clip_plus.available |
3225 && (curr == &(y_regs[PLUS_REGISTER]) | 3231 && (curr == &(y_regs[PLUS_REGISTER]) |
3226 || (!deleting && oap->regname == 0 | 3232 || (!deleting && oap->regname == 0 |
3227 && (clip_unnamed & CLIP_UNNAMED_PLUS)))) | 3233 && ((clip_unnamed | clip_unnamed_saved) & |
3234 CLIP_UNNAMED_PLUS)))) | |
3228 { | 3235 { |
3229 if (curr != &(y_regs[PLUS_REGISTER])) | 3236 if (curr != &(y_regs[PLUS_REGISTER])) |
3230 /* Copy the text from register 0 to the clipboard register. */ | 3237 /* Copy the text from register 0 to the clipboard register. */ |
3231 copy_yank_reg(&(y_regs[PLUS_REGISTER])); | 3238 copy_yank_reg(&(y_regs[PLUS_REGISTER])); |
3232 | 3239 |