aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorVVKot <volodymyr.kot.ua@gmail.com>2021-01-31 17:35:20 +0000
committerVVKot <volodymyr.kot.ua@gmail.com>2021-03-28 08:37:04 +0100
commit18b73ea3c8380f5c99ae6ec6f915e0d448391677 (patch)
tree483d61eda3698cf7a6a24703a152095af20223bc /src/nvim/testdir
parent2922f6e34bde27fa9788e806f871f50a2b46e6a7 (diff)
downloadrneovim-18b73ea3c8380f5c99ae6ec6f915e0d448391677.tar.gz
rneovim-18b73ea3c8380f5c99ae6ec6f915e0d448391677.tar.bz2
rneovim-18b73ea3c8380f5c99ae6ec6f915e0d448391677.zip
vim-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) https://github.com/vim/vim/commit/33d5ab3795720b7d986f9f17f660ee9e448466e0
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_tab.vim36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_tab.vim b/src/nvim/testdir/test_tab.vim
index b847dbd962..3be30245b9 100644
--- a/src/nvim/testdir/test_tab.vim
+++ b/src/nvim/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