summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_normal.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-05-07 17:39:23 +0100
committerBram Moolenaar <Bram@vim.org>2023-05-07 17:39:23 +0100
commit30b6d6104c3d541c41c868989c020b743e01af08 (patch)
tree3e5f10f40c94079631816960927b6161328861cc /src/testdir/test_normal.vim
parent048d9d25214049dfde04c468c14bd1708fb692b8 (diff)
patch 9.0.1521: failing redo of command with control charactersv9.0.1521
Problem: Failing redo of command with control characters. Solution: Use AppendToRedobuffLit() for colon commands. (closes #12354)
Diffstat (limited to 'src/testdir/test_normal.vim')
-rw-r--r--src/testdir/test_normal.vim23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim
index 03d29ae97b..470b41cb08 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -3635,11 +3635,32 @@ func Test_horiz_motion()
bwipe!
endfunc
-" Test for using a : command in operator pending mode
+" Test for using a ":" command in operator pending mode
func Test_normal_colon_op()
new
call setline(1, ['one', 'two'])
call assert_beeps("normal! Gc:d\<CR>")
+ call assert_equal(['one'], getline(1, '$'))
+
+ call setline(1, ['one…two…three!'])
+ normal! $
+ " Using ":" as a movement is characterwise exclusive
+ call feedkeys("d:normal! F…\<CR>", 'xt')
+ call assert_equal(['one…two!'], getline(1, '$'))
+ " Check that redoing a command with 0x80 bytes works
+ call feedkeys('.', 'xt')
+ call assert_equal(['one!'], getline(1, '$'))
+
+ call setline(1, ['one', 'two', 'three', 'four', 'five'])
+ " Add this to the command history
+ call feedkeys(":normal! G0\<CR>", 'xt')
+ " Use :normal! with control characters in operator pending mode
+ call feedkeys("d:normal! \<C-V>\<C-P>\<C-V>\<C-P>\<CR>", 'xt')
+ call assert_equal(['one', 'two', 'five'], getline(1, '$'))
+ " Check that redoing a command with control characters works
+ call feedkeys('.', 'xt')
+ call assert_equal(['five'], getline(1, '$'))
+
bwipe!
endfunc