Mercurial > vim
comparison src/testdir/test_normal.vim @ 32049:717a1a8dc751 v9.0.1356
patch 9.0.1356: cannot cancel "gr" with Esc
Commit: https://github.com/vim/vim/commit/4f026ea9f1ad9db262f0dba522768c84e5ae37b4
Author: zeertzjq <zeertzjq@outlook.com>
Date: Sun Feb 26 14:47:24 2023 +0000
patch 9.0.1356: cannot cancel "gr" with Esc
Problem: Cannot cancel "gr" with Esc.
Solution: Make "gr<Esc>" do nothing. (closes https://github.com/vim/vim/issues/12064)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 26 Feb 2023 16:00:05 +0100 |
parents | dbec60b8c253 |
children | cbf0ed5c83d0 |
comparison
equal
deleted
inserted
replaced
32048:0c1c18056343 | 32049:717a1a8dc751 |
---|---|
3271 call assert_equal('', getline(1)) | 3271 call assert_equal('', getline(1)) |
3272 bwipe! | 3272 bwipe! |
3273 endfunc | 3273 endfunc |
3274 | 3274 |
3275 " Test for the gr (virtual replace) command | 3275 " Test for the gr (virtual replace) command |
3276 " Test for the bug fixed by 7.4.387 | |
3277 func Test_gr_command() | 3276 func Test_gr_command() |
3278 enew! | 3277 enew! |
3278 " Test for the bug fixed by 7.4.387 | |
3279 let save_cpo = &cpo | 3279 let save_cpo = &cpo |
3280 call append(0, ['First line', 'Second line', 'Third line']) | 3280 call append(0, ['First line', 'Second line', 'Third line']) |
3281 exe "normal i\<C-G>u" | 3281 exe "normal i\<C-G>u" |
3282 call cursor(2, 1) | 3282 call cursor(2, 1) |
3283 set cpo-=X | 3283 set cpo-=X |
3286 undo | 3286 undo |
3287 set cpo+=X | 3287 set cpo+=X |
3288 normal 4gro | 3288 normal 4gro |
3289 call assert_equal('ooooecond line', getline(2)) | 3289 call assert_equal('ooooecond line', getline(2)) |
3290 let &cpo = save_cpo | 3290 let &cpo = save_cpo |
3291 | |
3291 normal! ggvegrx | 3292 normal! ggvegrx |
3292 call assert_equal('xxxxx line', getline(1)) | 3293 call assert_equal('xxxxx line', getline(1)) |
3293 exe "normal! gggr\<C-V>122" | 3294 exe "normal! gggr\<C-V>122" |
3294 call assert_equal('zxxxx line', getline(1)) | 3295 call assert_equal('zxxxx line', getline(1)) |
3296 | |
3295 set virtualedit=all | 3297 set virtualedit=all |
3296 normal! 15|grl | 3298 normal! 15|grl |
3297 call assert_equal('zxxxx line l', getline(1)) | 3299 call assert_equal('zxxxx line l', getline(1)) |
3298 set virtualedit& | 3300 set virtualedit& |
3299 set nomodifiable | 3301 set nomodifiable |
3300 call assert_fails('normal! grx', 'E21:') | 3302 call assert_fails('normal! grx', 'E21:') |
3301 call assert_fails('normal! gRx', 'E21:') | 3303 call assert_fails('normal! gRx', 'E21:') |
3304 call assert_nobeep("normal! gr\<Esc>") | |
3302 set modifiable& | 3305 set modifiable& |
3303 enew! | 3306 |
3307 call assert_nobeep("normal! gr\<Esc>") | |
3308 call assert_beeps("normal! cgr\<Esc>") | |
3309 | |
3310 call assert_equal('zxxxx line l', getline(1)) | |
3311 exe "normal! 2|gr\<C-V>\<Esc>" | |
3312 call assert_equal("z\<Esc>xx line l", getline(1)) | |
3313 | |
3314 call setline(1, 'abcdef') | |
3315 exe "normal! 0gr\<C-O>lx" | |
3316 call assert_equal("\<C-O>def", getline(1)) | |
3317 | |
3318 call setline(1, 'abcdef') | |
3319 exe "normal! 0gr\<C-G>lx" | |
3320 call assert_equal("\<C-G>def", getline(1)) | |
3321 | |
3322 bwipe! | |
3304 endfunc | 3323 endfunc |
3305 | 3324 |
3306 func Test_nv_hat_count() | 3325 func Test_nv_hat_count() |
3307 %bwipeout! | 3326 %bwipeout! |
3308 let l:nr = bufnr('%') + 1 | 3327 let l:nr = bufnr('%') + 1 |