Mercurial > vim
comparison src/testdir/test_edit.vim @ 20832:045442aa392b v8.2.0968
patch 8.2.0968: no proper testing of the 'cpoptions' flags
Commit: https://github.com/vim/vim/commit/c9630d2658af9dcaa01913e899b201bfdef7b536
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 13 13:20:48 2020 +0200
patch 8.2.0968: no proper testing of the 'cpoptions' flags
Problem: No proper testing of the 'cpoptions' flags.
Solution: Add tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/6251)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 13 Jun 2020 13:30:04 +0200 |
parents | bce10d039e06 |
children | 1725bb56178a |
comparison
equal
deleted
inserted
replaced
20831:415f3c972a53 | 20832:045442aa392b |
---|---|
1572 call assert_equal('abc', getline(1)) | 1572 call assert_equal('abc', getline(1)) |
1573 set showmode& showcmd& | 1573 set showmode& showcmd& |
1574 close! | 1574 close! |
1575 endfunc | 1575 endfunc |
1576 | 1576 |
1577 " Test for inserting text in a line with only spaces ('H' flag in 'cpoptions') | |
1578 func Test_edit_cpo_H() | |
1579 new | |
1580 call setline(1, ' ') | |
1581 normal! Ia | |
1582 call assert_equal(' a', getline(1)) | |
1583 set cpo+=H | |
1584 call setline(1, ' ') | |
1585 normal! Ia | |
1586 call assert_equal(' a ', getline(1)) | |
1587 set cpo-=H | |
1588 close! | |
1589 endfunc | |
1590 | |
1591 " Test for inserting tab in virtual replace mode ('L' flag in 'cpoptions') | |
1592 func Test_edit_cpo_L() | |
1593 new | |
1594 call setline(1, 'abcdefghijklmnopqr') | |
1595 exe "normal 0gR\<Tab>" | |
1596 call assert_equal("\<Tab>ijklmnopqr", getline(1)) | |
1597 set cpo+=L | |
1598 set list | |
1599 call setline(1, 'abcdefghijklmnopqr') | |
1600 exe "normal 0gR\<Tab>" | |
1601 call assert_equal("\<Tab>cdefghijklmnopqr", getline(1)) | |
1602 set nolist | |
1603 call setline(1, 'abcdefghijklmnopqr') | |
1604 exe "normal 0gR\<Tab>" | |
1605 call assert_equal("\<Tab>ijklmnopqr", getline(1)) | |
1606 set cpo-=L | |
1607 %bw! | |
1608 endfunc | |
1609 | |
1610 " vim: shiftwidth=2 sts=2 expandtab | 1577 " vim: shiftwidth=2 sts=2 expandtab |