comparison src/testdir/test_normal.vim @ 18475:709c6b0dc78f v8.1.2231

patch 8.1.2231: not easy to move to the middle of a text line Commit: https://github.com/vim/vim/commit/8b530c1ff91f07cf6b0289a536992b7dfbc86598 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Oct 28 02:13:05 2019 +0100 patch 8.1.2231: not easy to move to the middle of a text line Problem: Not easy to move to the middle of a text line. Solution: Add the gM command. (Yasuhiro Matsumoto, closes https://github.com/vim/vim/issues/2070)
author Bram Moolenaar <Bram@vim.org>
date Mon, 28 Oct 2019 02:15:05 +0100
parents 0eeaa9a6e4e7
children 2faf6c331cb8
comparison
equal deleted inserted replaced
18474:95daf3963003 18475:709c6b0dc78f
1731 %d 1731 %d
1732 15vsp 1732 15vsp
1733 set wrap listchars= sbr= 1733 set wrap listchars= sbr=
1734 let lineA='abcdefghijklmnopqrstuvwxyz' 1734 let lineA='abcdefghijklmnopqrstuvwxyz'
1735 let lineB='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' 1735 let lineB='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
1736 let lineC='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
1736 $put =lineA 1737 $put =lineA
1737 $put =lineB 1738 $put =lineB
1738 1739
1739 norm! 3gg0dgk 1740 norm! 3gg0dgk
1740 call assert_equal(['', 'abcdefghijklmno', '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'], getline(1, '$')) 1741 call assert_equal(['', 'abcdefghijklmno', '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'], getline(1, '$'))
1764 call assert_equal('n', getreg(0)) 1765 call assert_equal('n', getreg(0))
1765 norm! g^yl 1766 norm! g^yl
1766 call assert_equal(15, col('.')) 1767 call assert_equal(15, col('.'))
1767 call assert_equal('l', getreg(0)) 1768 call assert_equal('l', getreg(0))
1768 1769
1770 norm! 2ggdd
1771 $put =lineC
1772
1773 " Test for gM
1774 norm! gMyl
1775 call assert_equal(73, col('.'))
1776 call assert_equal('0', getreg(0))
1777 " Test for 20gM
1778 norm! 20gMyl
1779 call assert_equal(29, col('.'))
1780 call assert_equal('S', getreg(0))
1781 " Test for 60gM
1782 norm! 60gMyl
1783 call assert_equal(87, col('.'))
1784 call assert_equal('E', getreg(0))
1785
1786 " Test for g Ctrl-G
1787 set ff=unix
1788 let a=execute(":norm! g\<c-g>")
1789 call assert_match('Col 87 of 144; Line 2 of 2; Word 1 of 1; Byte 88 of 146', a)
1790
1769 " Test for gI 1791 " Test for gI
1770 norm! gIfoo 1792 norm! gIfoo
1771 call assert_equal(['', 'fooabcdefghijk lmno0123456789AMNOPQRSTUVWXYZ'], getline(1,'$')) 1793 call assert_equal(['', 'foo0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'], getline(1,'$'))
1772 1794
1773 " Test for gi 1795 " Test for gi
1774 wincmd c 1796 wincmd c
1775 %d 1797 %d
1776 set tw=0 1798 set tw=0