Mercurial > vim
comparison src/testdir/test_tab.vim @ 14243:fbf0681606fa v8.1.0138
patch 8.1.0138: negative value of 'softtabstop' not used correctly
commit https://github.com/vim/vim/commit/33d5ab3795720b7d986f9f17f660ee9e448466e0
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jul 2 20:51:24 2018 +0200
patch 8.1.0138: negative value of 'softtabstop' not used correctly
Problem: Negative value of 'softtabstop' not used correctly.
Solution: Use get_sts_value(). (Tom Ryder)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 02 Jul 2018 21:00:08 +0200 |
parents | aa658b33f25a |
children | 752ef53d3731 |
comparison
equal
deleted
inserted
replaced
14242:4b3fe18a37e8 | 14243:fbf0681606fa |
---|---|
1 " Various tests for inserting a Tab. | |
1 | 2 |
2 " Tests for "r<Tab>" with 'smarttab' and 'expandtab' set/not set. | 3 " Tests for "r<Tab>" with 'smarttab' and 'expandtab' set/not set. |
3 " Also test that dv_ works correctly | 4 " Also test that dv_ works correctly |
4 func Test_smarttab() | 5 func Test_smarttab() |
5 enew! | 6 enew! |
41 exe "normal fwdv_" | 42 exe "normal fwdv_" |
42 call assert_equal(' with whitespace', getline('.')) | 43 call assert_equal(' with whitespace', getline('.')) |
43 enew! | 44 enew! |
44 set expandtab& smartindent& copyindent& ts& sw& sts& | 45 set expandtab& smartindent& copyindent& ts& sw& sts& |
45 endfunc | 46 endfunc |
47 | |
48 func Test_softtabstop() | |
49 new | |
50 set sts=0 sw=0 | |
51 exe "normal ix\<Tab>x\<Esc>" | |
52 call assert_equal("x\tx", getline(1)) | |
53 | |
54 call setline(1, '') | |
55 set sts=4 | |
56 exe "normal ix\<Tab>x\<Esc>" | |
57 call assert_equal("x x", getline(1)) | |
58 | |
59 call setline(1, '') | |
60 set sts=-1 sw=4 | |
61 exe "normal ix\<Tab>x\<Esc>" | |
62 call assert_equal("x x", getline(1)) | |
63 | |
64 call setline(1, 'x ') | |
65 set sts=0 sw=0 backspace=start | |
66 exe "normal A\<BS>x\<Esc>" | |
67 call assert_equal("x x", getline(1)) | |
68 | |
69 call setline(1, 'x ') | |
70 set sts=4 | |
71 exe "normal A\<BS>x\<Esc>" | |
72 call assert_equal("x x", getline(1)) | |
73 | |
74 call setline(1, 'x ') | |
75 set sts=-1 sw=4 | |
76 exe "normal A\<BS>x\<Esc>" | |
77 call assert_equal("x x", getline(1)) | |
78 | |
79 set sts=0 sw=0 backspace& | |
80 bwipe! | |
81 endfunc |