Mercurial > vim
comparison src/testdir/test_visual.vim @ 34451:d06ffca91441 v9.1.0142
patch 9.1.0142: getregion() can be improved
Commit: https://github.com/vim/vim/commit/19b718828d8d5fab52d94c6cdba694641879ab38
Author: Shougo Matsushita <Shougo.Matsu@gmail.com>
Date: Wed Feb 28 22:48:12 2024 +0100
patch 9.1.0142: getregion() can be improved
Problem: getregion() can be improved (after v9.1.120)
Solution: change getregion() implementation to use pos as lists and
one optional {opt} dictionary (Shougo Matsushita)
Note: The following is a breaking change!
Currently, the getregion() function (included as of patch v9.1.120) takes
3 arguments: the first 2 arguments are strings, describing a position,
arg3 is the type string.
However, that is slightly inflexible, there is no way to specify
additional arguments. So let's instead change the function signature to:
getregion(pos1, pos2 [, {Dict}]) where both pos1 and pos2 are lists.
This is slightly cleaner, and gives us the flexibility to specify
additional arguments as key/value pairs to the optional Dict arg.
Now it supports the "type" key to specify the selection type
(characterwise, blockwise or linewise) and now in addition one can also
define the selection type, independently of what the 'selection' option
actually is.
Technically, this is a breaking change, but since the getregion()
Vimscript function is still quite new, this should be fine.
closes: #14090
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 28 Feb 2024 23:00:03 +0100 |
parents | 940c794b6ba7 |
children | 125dcecbfa09 |
comparison
equal
deleted
inserted
replaced
34450:4b3ffb6965ec | 34451:d06ffca91441 |
---|---|
1636 call setline(1, ['one', 'two', 'three']) | 1636 call setline(1, ['one', 'two', 'three']) |
1637 | 1637 |
1638 " Visual mode | 1638 " Visual mode |
1639 call cursor(1, 1) | 1639 call cursor(1, 1) |
1640 call feedkeys("\<ESC>vjl", 'tx') | 1640 call feedkeys("\<ESC>vjl", 'tx') |
1641 call assert_equal(['one', 'tw'], 'v'->getregion('.', 'v')) | 1641 call assert_equal(['one', 'tw'], |
1642 call assert_equal(['one', 'tw'], '.'->getregion('v', 'v')) | 1642 \ 'v'->getpos()->getregion(getpos('.'))) |
1643 call assert_equal(['o'], 'v'->getregion('v', 'v')) | 1643 call assert_equal(['one', 'tw'], |
1644 call assert_equal(['w'], '.'->getregion('.', 'v')) | 1644 \ '.'->getpos()->getregion(getpos('v'))) |
1645 call assert_equal(['one', 'two'], '.'->getregion('v', 'V')) | 1645 call assert_equal(['o'], |
1646 call assert_equal(['on', 'tw'], '.'->getregion('v', "\<C-v>")) | 1646 \ 'v'->getpos()->getregion(getpos('v'))) |
1647 call assert_equal(['w'], | |
1648 \ '.'->getpos()->getregion(getpos('.'), #{ type: 'v' })) | |
1649 call assert_equal(['one', 'two'], | |
1650 \ getpos('.')->getregion(getpos('v'), #{ type: 'V' })) | |
1651 call assert_equal(['on', 'tw'], | |
1652 \ getpos('.')->getregion(getpos('v'), #{ type: "\<C-v>" })) | |
1647 | 1653 |
1648 " Line visual mode | 1654 " Line visual mode |
1649 call cursor(1, 1) | 1655 call cursor(1, 1) |
1650 call feedkeys("\<ESC>Vl", 'tx') | 1656 call feedkeys("\<ESC>Vl", 'tx') |
1651 call assert_equal(['one'], getregion('v', '.', 'V')) | 1657 call assert_equal(['one'], |
1652 call assert_equal(['one'], getregion('.', 'v', 'V')) | 1658 \ getregion(getpos('v'), getpos('.'), #{ type: 'V' })) |
1653 call assert_equal(['one'], getregion('v', 'v', 'V')) | 1659 call assert_equal(['one'], |
1654 call assert_equal(['one'], getregion('.', '.', 'V')) | 1660 \ getregion(getpos('.'), getpos('v'), #{ type: 'V' })) |
1655 call assert_equal(['on'], '.'->getregion('v', 'v')) | 1661 call assert_equal(['one'], |
1656 call assert_equal(['on'], '.'->getregion('v', "\<C-v>")) | 1662 \ getregion(getpos('v'), getpos('v'), #{ type: 'V' })) |
1663 call assert_equal(['one'], | |
1664 \ getregion(getpos('.'), getpos('.'), #{ type: 'V' })) | |
1665 call assert_equal(['on'], | |
1666 \ getpos('.')->getregion(getpos('v'), #{ type: 'v' })) | |
1667 call assert_equal(['on'], | |
1668 \ getpos('.')->getregion(getpos('v'), #{ type: "\<C-v>" })) | |
1657 | 1669 |
1658 " Block visual mode | 1670 " Block visual mode |
1659 call cursor(1, 1) | 1671 call cursor(1, 1) |
1660 call feedkeys("\<ESC>\<C-v>ll", 'tx') | 1672 call feedkeys("\<ESC>\<C-v>ll", 'tx') |
1661 call assert_equal(['one'], getregion('v', '.', "\<C-v>")) | 1673 call assert_equal(['one'], |
1662 call assert_equal(['one'], getregion('.', 'v', "\<C-v>")) | 1674 \ getregion(getpos('v'), getpos('.'), #{ type: "\<C-v>" })) |
1663 call assert_equal(['o'], getregion('v', 'v', "\<C-v>")) | 1675 call assert_equal(['one'], |
1664 call assert_equal(['e'], getregion('.', '.', "\<C-v>")) | 1676 \ getregion(getpos('.'), getpos('v'), #{ type: "\<C-v>" })) |
1665 call assert_equal(['one'], '.'->getregion('v', 'V')) | 1677 call assert_equal(['o'], |
1666 call assert_equal(['one'], '.'->getregion('v', 'v')) | 1678 \ getregion(getpos('v'), getpos('v'), #{ type: "\<C-v>" })) |
1679 call assert_equal(['e'], | |
1680 \ getregion(getpos('.'), getpos('.'), #{ type: "\<C-v>" })) | |
1681 call assert_equal(['one'], | |
1682 \ '.'->getpos()->getregion(getpos('v'), #{ type: 'V' })) | |
1683 call assert_equal(['one'], | |
1684 \ '.'->getpos()->getregion(getpos('v'), #{ type: 'v' })) | |
1667 | 1685 |
1668 " Using Marks | 1686 " Using Marks |
1669 call setpos("'a", [0, 2, 3, 0]) | 1687 call setpos("'a", [0, 2, 3, 0]) |
1670 call cursor(1, 1) | 1688 call cursor(1, 1) |
1671 call assert_equal(['one', 'two'], "'a"->getregion('.', 'v')) | 1689 call assert_equal(['one', 'two'], |
1672 call assert_equal(['one', 'two'], "."->getregion("'a", 'v')) | 1690 \ "'a"->getpos()->getregion(getpos('.'), #{ type: 'v' })) |
1673 call assert_equal(['one', 'two'], "."->getregion("'a", 'V')) | 1691 call assert_equal(['one', 'two'], |
1674 call assert_equal(['two'], "'a"->getregion("'a", 'V')) | 1692 \ "."->getpos()->getregion(getpos("'a"), #{ type: 'v' })) |
1675 call assert_equal(['one', 'two'], "."->getregion("'a", "\<c-v>")) | 1693 call assert_equal(['one', 'two'], |
1694 \ "."->getpos()->getregion(getpos("'a"), #{ type: 'V' })) | |
1695 call assert_equal(['two'], | |
1696 \ "'a"->getpos()->getregion(getpos("'a"), #{ type: 'V' })) | |
1697 call assert_equal(['one', 'two'], | |
1698 \ "."->getpos()->getregion(getpos("'a"), #{ type: "\<c-v>" })) | |
1699 | |
1700 " Using List | |
1701 call cursor(1, 1) | |
1702 call assert_equal(['one', 'two'], | |
1703 \ [0, 2, 3, 0]->getregion(getpos('.'), #{ type: 'v' })) | |
1704 call assert_equal(['one', 'two'], | |
1705 \ '.'->getpos()->getregion([0, 2, 3, 0], #{ type: 'v' })) | |
1706 call assert_equal(['one', 'two'], | |
1707 \ '.'->getpos()->getregion([0, 2, 3, 0], #{ type: 'V' })) | |
1708 call assert_equal(['two'], | |
1709 \ [0, 2, 3, 0]->getregion([0, 2, 3, 0], #{ type: 'V' })) | |
1710 call assert_equal(['one', 'two'], | |
1711 \ '.'->getpos()->getregion([0, 2, 3, 0], #{ type: "\<c-v>" })) | |
1676 | 1712 |
1677 " Multiline with line visual mode | 1713 " Multiline with line visual mode |
1678 call cursor(1, 1) | 1714 call cursor(1, 1) |
1679 call feedkeys("\<ESC>Vjj", 'tx') | 1715 call feedkeys("\<ESC>Vjj", 'tx') |
1680 call assert_equal(['one', 'two', 'three'], getregion('v', '.', 'V')) | 1716 call assert_equal(['one', 'two', 'three'], |
1717 \ getregion(getpos('v'), getpos('.'), #{ type: 'V' })) | |
1681 | 1718 |
1682 " Multiline with block visual mode | 1719 " Multiline with block visual mode |
1683 call cursor(1, 1) | 1720 call cursor(1, 1) |
1684 call feedkeys("\<ESC>\<C-v>jj", 'tx') | 1721 call feedkeys("\<ESC>\<C-v>jj", 'tx') |
1685 call assert_equal(['o', 't', 't'], getregion('v', '.', "\<C-v>")) | 1722 call assert_equal(['o', 't', 't'], |
1723 \ getregion(getpos('v'), getpos('.'), #{ type: "\<C-v>" })) | |
1686 | 1724 |
1687 call cursor(1, 1) | 1725 call cursor(1, 1) |
1688 call feedkeys("\<ESC>\<C-v>jj$", 'tx') | 1726 call feedkeys("\<ESC>\<C-v>jj$", 'tx') |
1689 call assert_equal(['one', 'two', 'three'], getregion('v', '.', "\<C-v>")) | 1727 call assert_equal(['one', 'two', 'three'], |
1728 \ getregion(getpos('v'), getpos('.'), #{ type: "\<C-v>" })) | |
1690 | 1729 |
1691 " 'virtualedit' | 1730 " 'virtualedit' |
1692 set virtualedit=all | 1731 set virtualedit=all |
1693 call cursor(1, 1) | 1732 call cursor(1, 1) |
1694 call feedkeys("\<ESC>\<C-v>10ljj$", 'tx') | 1733 call feedkeys("\<ESC>\<C-v>10ljj$", 'tx') |
1695 call assert_equal(['one ', 'two ', 'three '], | 1734 call assert_equal(['one ', 'two ', 'three '], |
1696 \ getregion('v', '.', "\<C-v>")) | 1735 \ getregion(getpos('v'), getpos('.'), #{ type: "\<C-v>" })) |
1697 set virtualedit& | 1736 set virtualedit& |
1698 | 1737 |
1699 " Invalid position | 1738 " Invalid position |
1700 call cursor(1, 1) | 1739 call cursor(1, 1) |
1701 call feedkeys("\<ESC>vjj$", 'tx') | 1740 call feedkeys("\<ESC>vjj$", 'tx') |
1702 call assert_fails("call getregion(1, 2, 'v')", 'E1174:') | 1741 call assert_fails("call getregion(1, 2)", 'E1211:') |
1703 call assert_fails("call getregion('.', {}, 'v')", 'E1174:') | 1742 call assert_fails("call getregion(getpos('.'), {})", 'E1211:') |
1704 call assert_equal([], getregion('', '.', 'v')) | 1743 call assert_equal([], getregion(getpos('.'), getpos('.'), #{ type: '' })) |
1705 call assert_equal([], getregion('.', '.', '')) | 1744 |
1706 call feedkeys("\<ESC>", 'tx') | |
1707 call assert_equal([], getregion('v', '.', 'v')) | |
1708 | |
1709 " using an unset mark | |
1710 call assert_equal([], "'z"->getregion(".", 'V')) | |
1711 " using the wrong type | 1745 " using the wrong type |
1712 call assert_fails(':echo "."->getregion([],"V")', 'E1174:') | 1746 call assert_fails(':echo "."->getpos()->getregion("$", [])', 'E1211:') |
1713 call assert_fails(':echo "."->getregion("$", {})', 'E1174:') | 1747 |
1714 call assert_fails(':echo [0, 1, 1, 0]->getregion("$", "v")', 'E1174:') | |
1715 " using a mark in another buffer | 1748 " using a mark in another buffer |
1716 new | 1749 new |
1717 let newbuf = bufnr() | 1750 let newbuf = bufnr() |
1718 call setline(1, range(10)) | 1751 call setline(1, range(10)) |
1719 normal! GmA | 1752 normal! GmA |
1720 wincmd p | 1753 wincmd p |
1721 call assert_equal([newbuf, 10, 1, 0], getpos("'A")) | 1754 call assert_equal([newbuf, 10, 1, 0], getpos("'A")) |
1722 call assert_equal([], getregion(".", "'A", 'v')) | 1755 call assert_equal([], getregion(getpos('.'), getpos("'A"), #{ type: 'v' })) |
1723 call assert_equal([], getregion("'A", ".", 'v')) | 1756 call assert_equal([], getregion(getpos("'A"), getpos('.'), #{ type: 'v' })) |
1724 exe newbuf .. 'bwipe!' | 1757 exe newbuf .. 'bwipe!' |
1725 | 1758 |
1726 bwipe! | 1759 bwipe! |
1727 " Selection in starts or ends in the middle of a multibyte character | 1760 " Selection in starts or ends in the middle of a multibyte character |
1728 new | 1761 new |
1732 \ "1234567890" | 1765 \ "1234567890" |
1733 \ ]) | 1766 \ ]) |
1734 call cursor(1, 3) | 1767 call cursor(1, 3) |
1735 call feedkeys("\<Esc>\<C-v>ljj", 'xt') | 1768 call feedkeys("\<Esc>\<C-v>ljj", 'xt') |
1736 call assert_equal(['cd', "\u00ab ", '34'], | 1769 call assert_equal(['cd', "\u00ab ", '34'], |
1737 \ getregion('v', '.', "\<C-v>")) | 1770 \ getregion(getpos('v'), getpos('.'), #{ type: "\<C-v>" })) |
1738 call cursor(1, 4) | 1771 call cursor(1, 4) |
1739 call feedkeys("\<Esc>\<C-v>ljj", 'xt') | 1772 call feedkeys("\<Esc>\<C-v>ljj", 'xt') |
1740 call assert_equal(['de', "\U0001f1e7", '45'], | 1773 call assert_equal(['de', "\U0001f1e7", '45'], |
1741 \ getregion('v', '.', "\<C-v>")) | 1774 \ getregion(getpos('v'), getpos('.'), #{ type: "\<C-v>" })) |
1742 call cursor(1, 5) | 1775 call cursor(1, 5) |
1743 call feedkeys("\<Esc>\<C-v>jj", 'xt') | 1776 call feedkeys("\<Esc>\<C-v>jj", 'xt') |
1744 call assert_equal(['e', ' ', '5'], getregion('v', '.', "\<C-v>")) | 1777 call assert_equal(['e', ' ', '5'], |
1778 \ getregion(getpos('v'), getpos('.'), #{ type: "\<C-v>" })) | |
1745 call cursor(1, 1) | 1779 call cursor(1, 1) |
1746 call feedkeys("\<Esc>vj", 'xt') | 1780 call feedkeys("\<Esc>vj", 'xt') |
1747 call assert_equal(['abcdefghijk«', "\U0001f1e6"], getregion('v', '.', "v")) | 1781 call assert_equal(['abcdefghijk«', "\U0001f1e6"], |
1782 \ getregion(getpos('v'), getpos('.'), #{ type: 'v' })) | |
1748 " marks on multibyte chars | 1783 " marks on multibyte chars |
1749 set selection=exclusive | 1784 set selection=exclusive |
1750 call setpos("'a", [0, 1, 11, 0]) | 1785 call setpos("'a", [0, 1, 11, 0]) |
1751 call setpos("'b", [0, 2, 16, 0]) | 1786 call setpos("'b", [0, 2, 16, 0]) |
1752 call setpos("'c", [0, 2, 0, 0]) | 1787 call setpos("'c", [0, 2, 0, 0]) |
1753 call cursor(1, 1) | 1788 call cursor(1, 1) |
1754 call assert_equal(['ghijk', '🇨«🇩'], getregion("'a", "'b", "\<c-v>")) | 1789 call assert_equal(['ghijk', '🇨«🇩'], |
1755 call assert_equal(['k«', '🇦«🇧«🇨'], getregion("'a", "'b", "v")) | 1790 \ getregion(getpos("'a"), getpos("'b"), #{ type: "\<c-v>" })) |
1756 call assert_equal(['k«'], getregion("'a", "'c", "v")) | 1791 call assert_equal(['k«', '🇦«🇧«🇨'], |
1792 \ getregion(getpos("'a"), getpos("'b"), #{ type: 'v' })) | |
1793 call assert_equal(['k«'], | |
1794 \ getregion(getpos("'a"), getpos("'c"), #{ type: 'v' })) | |
1795 | |
1796 " use inclusive selection, although 'selection' is exclusive | |
1797 call setpos("'a", [0, 1, 11, 0]) | |
1798 call setpos("'b", [0, 1, 1, 0]) | |
1799 call assert_equal(['abcdefghijk'], | |
1800 \ getregion(getpos("'a"), getpos("'b"), #{ type: "\<c-v>", exclusive: v:false })) | |
1801 call assert_equal(['abcdefghij'], | |
1802 \ getregion(getpos("'a"), getpos("'b"), #{ type: "\<c-v>", exclusive: v:true })) | |
1803 call assert_equal(['abcdefghijk'], | |
1804 \ getregion(getpos("'a"), getpos("'b"), #{ type: 'v', exclusive: 0 })) | |
1805 call assert_equal(['abcdefghij'], | |
1806 \ getregion(getpos("'a"), getpos("'b"), #{ type: 'v', exclusive: 1 })) | |
1807 call assert_equal(['abcdefghijk«'], | |
1808 \ getregion(getpos("'a"), getpos("'b"), #{ type: 'V', exclusive: 0 })) | |
1809 call assert_equal(['abcdefghijk«'], | |
1810 \ getregion(getpos("'a"), getpos("'b"), #{ type: 'V', exclusive: 1 })) | |
1757 | 1811 |
1758 bwipe! | 1812 bwipe! |
1759 | 1813 |
1760 " Exclusive selection | 1814 " Exclusive selection |
1761 new | 1815 new |
1762 set selection=exclusive | 1816 set selection=exclusive |
1763 call setline(1, ["a\tc", "x\tz", '', '']) | 1817 call setline(1, ["a\tc", "x\tz", '', '']) |
1764 call cursor(1, 1) | 1818 call cursor(1, 1) |
1765 call feedkeys("\<Esc>v2l", 'xt') | 1819 call feedkeys("\<Esc>v2l", 'xt') |
1766 call assert_equal(["a\t"], getregion('v', '.', 'v')) | 1820 call assert_equal(["a\t"], |
1821 \ getregion(getpos('v'), getpos('.'), #{ type: 'v' })) | |
1767 call cursor(1, 1) | 1822 call cursor(1, 1) |
1768 call feedkeys("\<Esc>v$G", 'xt') | 1823 call feedkeys("\<Esc>v$G", 'xt') |
1769 call assert_equal(["a\tc", "x\tz", ''], getregion('v', '.', 'v')) | 1824 call assert_equal(["a\tc", "x\tz", ''], |
1825 \ getregion(getpos('v'), getpos('.'), #{ type: 'v' })) | |
1770 call cursor(1, 1) | 1826 call cursor(1, 1) |
1771 call feedkeys("\<Esc>v$j", 'xt') | 1827 call feedkeys("\<Esc>v$j", 'xt') |
1772 call assert_equal(["a\tc", "x\tz"], getregion('v', '.', 'v')) | 1828 call assert_equal(["a\tc", "x\tz"], |
1829 \ getregion(getpos('v'), getpos('.'), #{ type: 'v' })) | |
1773 call cursor(1, 1) | 1830 call cursor(1, 1) |
1774 call feedkeys("\<Esc>\<C-v>$j", 'xt') | 1831 call feedkeys("\<Esc>\<C-v>$j", 'xt') |
1775 call assert_equal(["a\tc", "x\tz"], getregion('v', '.', "\<C-v>")) | 1832 call assert_equal(["a\tc", "x\tz"], |
1833 \ getregion(getpos('v'), getpos('.'), #{ type: "\<C-v>" })) | |
1776 call cursor(1, 1) | 1834 call cursor(1, 1) |
1777 call feedkeys("\<Esc>\<C-v>$G", 'xt') | 1835 call feedkeys("\<Esc>\<C-v>$G", 'xt') |
1778 call assert_equal(["a", "x", '', ''], getregion('v', '.', "\<C-v>")) | 1836 call assert_equal(["a", "x", '', ''], |
1837 \ getregion(getpos('v'), getpos('.'), #{ type: "\<C-v>" })) | |
1779 call cursor(1, 1) | 1838 call cursor(1, 1) |
1780 call feedkeys("\<Esc>wv2j", 'xt') | 1839 call feedkeys("\<Esc>wv2j", 'xt') |
1781 call assert_equal(["c", "x\tz"], getregion('v', '.', 'v')) | 1840 call assert_equal(["c", "x\tz"], |
1841 \ getregion(getpos('v'), getpos('.'), #{ type: 'v' })) | |
1842 set selection& | |
1843 | |
1844 " Exclusive selection 2 | |
1845 new | |
1846 call setline(1, ["a\tc", "x\tz", '', '']) | |
1847 call cursor(1, 1) | |
1848 call feedkeys("\<Esc>v2l", 'xt') | |
1849 call assert_equal(["a\t"], | |
1850 \ getregion(getpos('v'), getpos('.'), #{ exclusive: v:true })) | |
1851 call cursor(1, 1) | |
1852 call feedkeys("\<Esc>v$G", 'xt') | |
1853 call assert_equal(["a\tc", "x\tz", ''], | |
1854 \ getregion(getpos('v'), getpos('.'), #{ exclusive: v:true })) | |
1855 call cursor(1, 1) | |
1856 call feedkeys("\<Esc>v$j", 'xt') | |
1857 call assert_equal(["a\tc", "x\tz"], | |
1858 \ getregion(getpos('v'), getpos('.'), #{ exclusive: v:true })) | |
1859 call cursor(1, 1) | |
1860 call feedkeys("\<Esc>\<C-v>$j", 'xt') | |
1861 call assert_equal(["a\tc", "x\tz"], | |
1862 \ getregion(getpos('v'), getpos('.'), | |
1863 \ #{ exclusive: v:true, type: "\<C-v>" })) | |
1864 call cursor(1, 1) | |
1865 call feedkeys("\<Esc>\<C-v>$G", 'xt') | |
1866 call assert_equal(["a", "x", '', ''], | |
1867 \ getregion(getpos('v'), getpos('.'), | |
1868 \ #{ exclusive: v:true, type: "\<C-v>" })) | |
1869 call cursor(1, 1) | |
1870 call feedkeys("\<Esc>wv2j", 'xt') | |
1871 call assert_equal(["c", "x\tz"], | |
1872 \ getregion(getpos('v'), getpos('.'), #{ exclusive: v:true })) | |
1782 | 1873 |
1783 " virtualedit | 1874 " virtualedit |
1875 set selection=exclusive | |
1784 set virtualedit=all | 1876 set virtualedit=all |
1785 call cursor(1, 1) | 1877 call cursor(1, 1) |
1786 call feedkeys("\<Esc>2lv2lj", 'xt') | 1878 call feedkeys("\<Esc>2lv2lj", 'xt') |
1787 call assert_equal([' c', 'x '], getregion('v', '.', 'v')) | 1879 call assert_equal([' c', 'x '], |
1880 \ getregion(getpos('v'), getpos('.'), #{ type: 'v' })) | |
1788 call cursor(1, 1) | 1881 call cursor(1, 1) |
1789 call feedkeys("\<Esc>2l\<C-v>2l2j", 'xt') | 1882 call feedkeys("\<Esc>2l\<C-v>2l2j", 'xt') |
1790 call assert_equal([' ', ' ', ' '], getregion('v', '.', "\<C-v>")) | 1883 call assert_equal([' ', ' ', ' '], |
1884 \ getregion(getpos('v'), getpos('.'), #{ type: "\<C-v>" })) | |
1791 set virtualedit& | 1885 set virtualedit& |
1792 set selection& | 1886 set selection& |
1793 | 1887 |
1794 bwipe! | 1888 bwipe! |
1795 endfunc | 1889 endfunc |