# HG changeset patch # User Bram Moolenaar # Date 1546287305 -3600 # Node ID de8dc397cd2aa8c505f6a1c5f04631c69f8322b5 # Parent 34455115ebdd102da898b5e482140752aa76eb15 patch 8.1.0668: no test for overstrike mode in the command line commit https://github.com/vim/vim/commit/c0676bab92bd6488e17d05a4a70dfff993ef524e Author: Bram Moolenaar Date: Mon Dec 31 21:03:02 2018 +0100 patch 8.1.0668: no test for overstrike mode in the command line Problem: No test for overstrike mode in the command line. Solution: Add a test. (Dominique Pelle, closes https://github.com/vim/vim/issues/3742) diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -581,4 +581,33 @@ func Test_setcmdpos() call assert_equal(1, setcmdpos(3)) endfunc +func Test_cmdline_overstrike() + let encodings = has('multi_byte') ? [ 'latin1', 'utf8' ] : [ 'latin1' ] + let encoding_save = &encoding + + for e in encodings + exe 'set encoding=' . e + + " Test overstrike in the middle of the command line. + call feedkeys(":\"01234\\\ab\\cd\", 'xt') + call assert_equal('"0ab1cd4', @:) + + " Test overstrike going beyond end of command line. + call feedkeys(":\"01234\\\ab\\cdefgh\", 'xt') + call assert_equal('"0ab1cdefgh', @:) + + " Test toggling insert/overstrike a few times. + call feedkeys(":\"01234\\ab\\cd\\ef\", 'xt') + call assert_equal('"ab0cd3ef4', @:) + endfor + + if has('multi_byte') + " Test overstrike with multi-byte characters. + call feedkeys(":\"テキストエディタ\\\ab\\cd\", 'xt') + call assert_equal('"テabキcdエディタ', @:) + endif + + let &encoding = encoding_save +endfunc + set cpo& diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -800,6 +800,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 668, +/**/ 667, /**/ 666,