diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-08-06 18:17:11 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-08-06 18:17:11 +0200 |
commit | 6b1ee34aa0236b50f675f3bbcd9bf0b7a3384f7f (patch) | |
tree | 0f3f8952da9b62bc8d344394f549cbcf4fdf4f3b /src/ops.c | |
parent | 04d17ae1678846c4857cd86cf3eaf47d60c04c85 (diff) | |
download | vim-6b1ee34aa0236b50f675f3bbcd9bf0b7a3384f7f.zip |
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)
Diffstat (limited to 'src/ops.c')
-rw-r--r-- | src/ops.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -1597,9 +1597,15 @@ adjust_clip_reg(rp) { /* If no reg. specified, and "unnamed" or "unnamedplus" is in 'clipboard', * use '*' or '+' reg, respectively. "unnamedplus" prevails. */ - if (*rp == 0 && clip_unnamed != 0) - *rp = ((clip_unnamed & CLIP_UNNAMED_PLUS) && clip_plus.available) + if (*rp == 0 && (clip_unnamed != 0 || clip_unnamed_saved != 0)) + { + if (clip_unnamed != 0) + *rp = ((clip_unnamed & CLIP_UNNAMED_PLUS) && clip_plus.available) + ? '+' : '*'; + else + *rp = ((clip_unnamed_saved & CLIP_UNNAMED_PLUS) && clip_plus.available) ? '+' : '*'; + } if (!clip_star.available && *rp == '*') *rp = 0; if (!clip_plus.available && *rp == '+') @@ -3203,7 +3209,7 @@ op_yank(oap, deleting, mess) if (clip_star.available && (curr == &(y_regs[STAR_REGISTER]) || (!deleting && oap->regname == 0 - && (clip_unnamed & CLIP_UNNAMED)))) + && ((clip_unnamed | clip_unnamed_saved) & CLIP_UNNAMED)))) { if (curr != &(y_regs[STAR_REGISTER])) /* Copy the text from register 0 to the clipboard register. */ @@ -3224,7 +3230,8 @@ op_yank(oap, deleting, mess) if (clip_plus.available && (curr == &(y_regs[PLUS_REGISTER]) || (!deleting && oap->regname == 0 - && (clip_unnamed & CLIP_UNNAMED_PLUS)))) + && ((clip_unnamed | clip_unnamed_saved) & + CLIP_UNNAMED_PLUS)))) { if (curr != &(y_regs[PLUS_REGISTER])) /* Copy the text from register 0 to the clipboard register. */ |