comparison src/testdir/test_backspace_opt.vim @ 16658:f776ce5d4ed8 v8.1.1331

patch 8.1.1331: test 29 is old style commit https://github.com/vim/vim/commit/fb222df28d5158516104a21cba7141a6240f4817 Author: Bram Moolenaar <Bram@vim.org> Date: Tue May 14 17:57:19 2019 +0200 patch 8.1.1331: test 29 is old style Problem: Test 29 is old style. Solution: Turn it into a new style test. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/4370)
author Bram Moolenaar <Bram@vim.org>
date Tue, 14 May 2019 18:00:07 +0200
parents 3ee84d270ea7
children b07672d13ff9
comparison
equal deleted inserted replaced
16657:5002df3f658b 16658:f776ce5d4ed8
54 set compatible 54 set compatible
55 call assert_equal('', &backspace) 55 call assert_equal('', &backspace)
56 set nocompatible viminfo+=nviminfo 56 set nocompatible viminfo+=nviminfo
57 endfunc 57 endfunc
58 58
59 " Test with backspace set to the non-compatible setting
60 func Test_backspace_ctrl_u()
61 new
62 call append(0, [
63 \ "1 this shouldn't be deleted",
64 \ "2 this shouldn't be deleted",
65 \ "3 this shouldn't be deleted",
66 \ "4 this should be deleted",
67 \ "5 this shouldn't be deleted",
68 \ "6 this shouldn't be deleted",
69 \ "7 this shouldn't be deleted",
70 \ "8 this shouldn't be deleted (not touched yet)"])
71 call cursor(2, 1)
72
73 set compatible
74 set backspace=2
75
76 exe "normal Avim1\<C-U>\<Esc>\<CR>"
77 exe "normal Avim2\<C-G>u\<C-U>\<Esc>\<CR>"
78
79 set cpo-=<
80 inoremap <c-u> <left><c-u>
81 exe "normal Avim3\<C-U>\<Esc>\<CR>"
82 iunmap <c-u>
83 exe "normal Avim4\<C-U>\<C-U>\<Esc>\<CR>"
84
85 " Test with backspace set to the compatible setting
86 set backspace= visualbell
87 exe "normal A vim5\<Esc>A\<C-U>\<C-U>\<Esc>\<CR>"
88 exe "normal A vim6\<Esc>Azwei\<C-G>u\<C-U>\<Esc>\<CR>"
89
90 inoremap <c-u> <left><c-u>
91 exe "normal A vim7\<C-U>\<C-U>\<Esc>\<CR>"
92
93 call assert_equal([
94 \ "1 this shouldn't be deleted",
95 \ "2 this shouldn't be deleted",
96 \ "3 this shouldn't be deleted",
97 \ "4 this should be deleted3",
98 \ "",
99 \ "6 this shouldn't be deleted vim5",
100 \ "7 this shouldn't be deleted vim6",
101 \ "8 this shouldn't be deleted (not touched yet) vim7",
102 \ ""], getline(1, '$'))
103
104 set compatible&vim
105 set visualbell&vim
106 set backspace&vim
107 close!
108 endfunc
109
59 " vim: shiftwidth=2 sts=2 expandtab 110 " vim: shiftwidth=2 sts=2 expandtab