diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-07-02 20:51:24 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-07-02 20:51:24 +0200 |
commit | 33d5ab3795720b7d986f9f17f660ee9e448466e0 (patch) | |
tree | 38af7f84382c74a45dc271d9f37eac9ac148dde4 /src/testdir/test_tab.vim | |
parent | ade55787978e15fe57c5cedf38c9f85bfe1d983c (diff) | |
download | vim-git-33d5ab3795720b7d986f9f17f660ee9e448466e0.tar.gz |
patch 8.1.0138: negative value of 'softtabstop' not used correctlyv8.1.0138
Problem: Negative value of 'softtabstop' not used correctly.
Solution: Use get_sts_value(). (Tom Ryder)
Diffstat (limited to 'src/testdir/test_tab.vim')
-rw-r--r-- | src/testdir/test_tab.vim | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/testdir/test_tab.vim b/src/testdir/test_tab.vim index b847dbd96..3be30245b 100644 --- a/src/testdir/test_tab.vim +++ b/src/testdir/test_tab.vim @@ -1,3 +1,4 @@ +" Various tests for inserting a Tab. " Tests for "r<Tab>" with 'smarttab' and 'expandtab' set/not set. " Also test that dv_ works correctly @@ -43,3 +44,38 @@ func Test_smarttab() enew! set expandtab& smartindent& copyindent& ts& sw& sts& endfunc + +func Test_softtabstop() + new + set sts=0 sw=0 + exe "normal ix\<Tab>x\<Esc>" + call assert_equal("x\tx", getline(1)) + + call setline(1, '') + set sts=4 + exe "normal ix\<Tab>x\<Esc>" + call assert_equal("x x", getline(1)) + + call setline(1, '') + set sts=-1 sw=4 + exe "normal ix\<Tab>x\<Esc>" + call assert_equal("x x", getline(1)) + + call setline(1, 'x ') + set sts=0 sw=0 backspace=start + exe "normal A\<BS>x\<Esc>" + call assert_equal("x x", getline(1)) + + call setline(1, 'x ') + set sts=4 + exe "normal A\<BS>x\<Esc>" + call assert_equal("x x", getline(1)) + + call setline(1, 'x ') + set sts=-1 sw=4 + exe "normal A\<BS>x\<Esc>" + call assert_equal("x x", getline(1)) + + set sts=0 sw=0 backspace& + bwipe! +endfunc |