aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-01-05 00:46:06 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-01-05 09:47:38 -0500
commit25cb2c722e74ea62c289ecba8a6e98db5ee67493 (patch)
tree1985ab29cd263db3e14ace22ba3644c38f837190 /src/nvim/testdir
parent5b897acfc1e9bf3c44f7e255743e2b9c8b6d1142 (diff)
downloadrneovim-25cb2c722e74ea62c289ecba8a6e98db5ee67493.tar.gz
rneovim-25cb2c722e74ea62c289ecba8a6e98db5ee67493.tar.bz2
rneovim-25cb2c722e74ea62c289ecba8a6e98db5ee67493.zip
vim-patch:8.2.0590: no 'backspace' value allows ignoring the insertion point
Problem: No 'backspace' value allows ignoring the insertion point. Solution: Add the "nostop" and 3 values. (Christian Brabandt, closes vim/vim#5940) https://github.com/vim/vim/commit/aa0489e12d227d24752cf16e4e97058ac32edcc1
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_backspace_opt.vim43
1 files changed, 42 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_backspace_opt.vim b/src/nvim/testdir/test_backspace_opt.vim
index cfae88dabd..d680b442db 100644
--- a/src/nvim/testdir/test_backspace_opt.vim
+++ b/src/nvim/testdir/test_backspace_opt.vim
@@ -19,6 +19,8 @@ func Test_backspace_option()
call assert_equal('eol', &backspace)
set backspace=start
call assert_equal('start', &backspace)
+ set backspace=nostop
+ call assert_equal('nostop', &backspace)
" Add the value
set backspace=
set backspace=indent
@@ -27,7 +29,11 @@ func Test_backspace_option()
call assert_equal('indent,eol', &backspace)
set backspace+=start
call assert_equal('indent,eol,start', &backspace)
+ set backspace+=nostop
+ call assert_equal('indent,eol,start,nostop', &backspace)
" Delete the value
+ set backspace-=nostop
+ call assert_equal('indent,eol,start', &backspace)
set backspace-=indent
call assert_equal('eol,start', &backspace)
set backspace-=start
@@ -47,7 +53,9 @@ func Test_backspace_option()
call assert_equal('1', &backspace)
set backspace=2
call assert_equal('2', &backspace)
- call assert_false(match(Exec('set backspace=3'), '.*E474'))
+ set backspace=3
+ call assert_equal('3', &backspace)
+ call assert_false(match(Exec('set backspace=4'), '.*E474'))
call assert_false(match(Exec('set backspace=10'), '.*E474'))
" Cleared when 'compatible' is set
@@ -101,6 +109,39 @@ func Test_backspace_ctrl_u()
\ "8 this shouldn't be deleted (not touched yet) vim7",
\ ""], getline(1, '$'))
+ " Reset values
+ set compatible&vim
+ set visualbell&vim
+ set backspace&vim
+
+ " Test new nostop option
+ %d_
+ let expected = "foo bar foobar"
+ call setline(1, expected)
+ call cursor(1, 8)
+ exe ":norm! ianotherone\<c-u>"
+ call assert_equal(expected, getline(1))
+ call cursor(1, 8)
+ exe ":norm! ianothertwo\<c-w>"
+ call assert_equal(expected, getline(1))
+
+ let content = getline(1)
+ for value in ['indent,nostop', 'eol,nostop', 'indent,eol,nostop', 'indent,eol,start,nostop']
+ exe ":set bs=".. value
+ %d _
+ call setline(1, content)
+ let expected = " foobar"
+ call cursor(1, 8)
+ exe ":norm! ianotherone\<c-u>"
+ call assert_equal(expected, getline(1), 'CTRL-U backspace value: '.. &bs)
+ let expected = "foo foobar"
+ call setline(1, content)
+ call cursor(1, 8)
+ exe ":norm! ianothertwo\<c-w>"
+ call assert_equal(expected, getline(1), 'CTRL-W backspace value: '.. &bs)
+ endfor
+
+ " Reset options
set compatible&vim
set visualbell&vim
set backspace&vim