diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-05-14 17:57:19 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-05-14 17:57:19 +0200 |
commit | fb222df28d5158516104a21cba7141a6240f4817 (patch) | |
tree | 6de535571696eae737efab50127a7e0f35b3680a /src/testdir/test_backspace_opt.vim | |
parent | 9e58787de737479fb210a3bfef7458d667406d17 (diff) |
patch 8.1.1331: test 29 is old stylev8.1.1331
Problem: Test 29 is old style.
Solution: Turn it into a new style test. (Yegappan Lakshmanan, closes #4370)
Diffstat (limited to 'src/testdir/test_backspace_opt.vim')
-rw-r--r-- | src/testdir/test_backspace_opt.vim | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/testdir/test_backspace_opt.vim b/src/testdir/test_backspace_opt.vim index fd81f42b66..e6ea0bcf5a 100644 --- a/src/testdir/test_backspace_opt.vim +++ b/src/testdir/test_backspace_opt.vim @@ -56,4 +56,55 @@ func Test_backspace_option() set nocompatible viminfo+=nviminfo endfunc +" Test with backspace set to the non-compatible setting +func Test_backspace_ctrl_u() + new + call append(0, [ + \ "1 this shouldn't be deleted", + \ "2 this shouldn't be deleted", + \ "3 this shouldn't be deleted", + \ "4 this should be deleted", + \ "5 this shouldn't be deleted", + \ "6 this shouldn't be deleted", + \ "7 this shouldn't be deleted", + \ "8 this shouldn't be deleted (not touched yet)"]) + call cursor(2, 1) + + set compatible + set backspace=2 + + exe "normal Avim1\<C-U>\<Esc>\<CR>" + exe "normal Avim2\<C-G>u\<C-U>\<Esc>\<CR>" + + set cpo-=< + inoremap <c-u> <left><c-u> + exe "normal Avim3\<C-U>\<Esc>\<CR>" + iunmap <c-u> + exe "normal Avim4\<C-U>\<C-U>\<Esc>\<CR>" + + " Test with backspace set to the compatible setting + set backspace= visualbell + exe "normal A vim5\<Esc>A\<C-U>\<C-U>\<Esc>\<CR>" + exe "normal A vim6\<Esc>Azwei\<C-G>u\<C-U>\<Esc>\<CR>" + + inoremap <c-u> <left><c-u> + exe "normal A vim7\<C-U>\<C-U>\<Esc>\<CR>" + + call assert_equal([ + \ "1 this shouldn't be deleted", + \ "2 this shouldn't be deleted", + \ "3 this shouldn't be deleted", + \ "4 this should be deleted3", + \ "", + \ "6 this shouldn't be deleted vim5", + \ "7 this shouldn't be deleted vim6", + \ "8 this shouldn't be deleted (not touched yet) vim7", + \ ""], getline(1, '$')) + + set compatible&vim + set visualbell&vim + set backspace&vim + close! +endfunc + " vim: shiftwidth=2 sts=2 expandtab |