Mercurial > vim
comparison src/ops.c @ 10827:e366b968bf08 v8.0.0303
patch 8.0.0303: bracketed paste does not work in Visual mode
commit https://github.com/vim/vim/commit/a1891848d970452cd775d35a4bccfdd9758a690a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 4 21:34:31 2017 +0100
patch 8.0.0303: bracketed paste does not work in Visual mode
Problem: Bracketed paste does not work in Visual mode.
Solution: Delete the text before pasting
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 04 Feb 2017 21:45:04 +0100 |
parents | 065da86ca6d2 |
children | f5bd684e47a1 |
comparison
equal
deleted
inserted
replaced
10826:c87e4d47304a | 10827:e366b968bf08 |
---|---|
1626 *rp = 0; | 1626 *rp = 0; |
1627 } | 1627 } |
1628 #endif | 1628 #endif |
1629 | 1629 |
1630 /* | 1630 /* |
1631 * Shift the delete registers: "9 is cleared, "8 becomes "9, etc. | |
1632 */ | |
1633 void | |
1634 shift_delete_registers() | |
1635 { | |
1636 int n; | |
1637 | |
1638 y_current = &y_regs[9]; | |
1639 free_yank_all(); /* free register nine */ | |
1640 for (n = 9; n > 1; --n) | |
1641 y_regs[n] = y_regs[n - 1]; | |
1642 y_previous = y_current = &y_regs[1]; | |
1643 y_regs[1].y_array = NULL; /* set register one to empty */ | |
1644 } | |
1645 | |
1646 /* | |
1631 * Handle a delete operation. | 1647 * Handle a delete operation. |
1632 * | 1648 * |
1633 * Return FAIL if undo failed, OK otherwise. | 1649 * Return FAIL if undo failed, OK otherwise. |
1634 */ | 1650 */ |
1635 int | 1651 int |
1737 * changed it. | 1753 * changed it. |
1738 */ | 1754 */ |
1739 if (orig_regname != 0 || oap->motion_type == MLINE | 1755 if (orig_regname != 0 || oap->motion_type == MLINE |
1740 || oap->line_count > 1 || oap->use_reg_one) | 1756 || oap->line_count > 1 || oap->use_reg_one) |
1741 { | 1757 { |
1742 y_current = &y_regs[9]; | 1758 shift_delete_registers(); |
1743 free_yank_all(); /* free register nine */ | |
1744 for (n = 9; n > 1; --n) | |
1745 y_regs[n] = y_regs[n - 1]; | |
1746 y_previous = y_current = &y_regs[1]; | |
1747 y_regs[1].y_array = NULL; /* set register one to empty */ | |
1748 if (op_yank(oap, TRUE, FALSE) == OK) | 1759 if (op_yank(oap, TRUE, FALSE) == OK) |
1749 did_yank = TRUE; | 1760 did_yank = TRUE; |
1750 } | 1761 } |
1751 | 1762 |
1752 /* Yank into small delete register when no named register specified | 1763 /* Yank into small delete register when no named register specified |