comparison src/testdir/test_edit.vim @ 27350:63179e8300f8 v8.2.4203

patch 8.2.4203: entering a character with CTRL-V may include modifiers Commit: https://github.com/vim/vim/commit/502d8ae3e8ed8b6f8dd2ff175f154f9aa87228ef Author: zeertzjq <zeertzjq@outlook.com> Date: Mon Jan 24 15:27:50 2022 +0000 patch 8.2.4203: entering a character with CTRL-V may include modifiers Problem: Entering a character with CTRL-V may include modifiers. Solution: Reset "mod_mask" when entering a character with digits after CTRL-V. (closes #9610)
author Bram Moolenaar <Bram@vim.org>
date Mon, 24 Jan 2022 16:30:05 +0100
parents 5e65d802bd52
children fb4c30606b4a
comparison
equal deleted inserted replaced
27349:b26e0d130e07 27350:63179e8300f8
1071 endtry 1071 endtry
1072 bw! 1072 bw!
1073 endfunc 1073 endfunc
1074 1074
1075 func Test_edit_CTRL_V() 1075 func Test_edit_CTRL_V()
1076 CheckFeature ebcdic 1076 CheckNotFeature ebcdic
1077
1077 new 1078 new
1078 call setline(1, ['abc']) 1079 call setline(1, ['abc'])
1079 call cursor(2, 1) 1080 call cursor(2, 1)
1081
1080 " force some redraws 1082 " force some redraws
1081 set showmode showcmd 1083 set showmode showcmd
1082 "call test_override_char_avail(1) 1084 call test_override('char_avail', 1)
1083 call test_override('ALL', 1) 1085
1084 call feedkeys("A\<c-v>\<c-n>\<c-v>\<c-l>\<c-v>\<c-b>\<esc>", 'tnix') 1086 call feedkeys("A\<c-v>\<c-n>\<c-v>\<c-l>\<c-v>\<c-b>\<esc>", 'tnix')
1085 call assert_equal(["abc\x0e\x0c\x02"], getline(1, '$')) 1087 call assert_equal(["abc\x0e\x0c\x02"], getline(1, '$'))
1086 1088
1087 if has("rightleft") && exists("+rl") 1089 if has("rightleft") && exists("+rl")
1088 set rl 1090 set rl
1091 call feedkeys("A\<c-v>\<c-n>\<c-v>\<c-l>\<c-v>\<c-b>\<esc>", 'tnix') 1093 call feedkeys("A\<c-v>\<c-n>\<c-v>\<c-l>\<c-v>\<c-b>\<esc>", 'tnix')
1092 call assert_equal(["abc\x0e\x0c\x02"], getline(1, '$')) 1094 call assert_equal(["abc\x0e\x0c\x02"], getline(1, '$'))
1093 set norl 1095 set norl
1094 endif 1096 endif
1095 1097
1096 call test_override('ALL', 0)
1097 set noshowmode showcmd 1098 set noshowmode showcmd
1099 call test_override('char_avail', 0)
1100
1101 " No modifiers should be applied to the char typed using i_CTRL-V_digit.
1102 call feedkeys(":append\<CR>\<C-V>76c\<C-V>76\<C-F2>\<C-V>u3c0j\<C-V>u3c0\<M-F3>\<CR>.\<CR>", 'tnix')
1103 call assert_equal('LcL<C-F2>πjπ<M-F3>', getline(2))
1104
1105 if has('osx')
1106 " A char with a modifier should not be a valid char for i_CTRL-V_digit.
1107 call feedkeys("o\<C-V>\<D-j>\<C-V>\<D-1>\<C-V>\<D-o>\<C-V>\<D-x>\<C-V>\<D-u>", 'tnix')
1108 call assert_equal('<D-j><D-1><D-o><D-x><D-u>', getline(3))
1109 endif
1110
1098 bw! 1111 bw!
1099 endfunc 1112 endfunc
1100 1113
1101 func Test_edit_F1() 1114 func Test_edit_F1()
1102 CheckFeature quickfix 1115 CheckFeature quickfix