To: vim_dev@googlegroups.com Subject: Patch 8.1.0668 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.0668 Problem: No test for overstrike mode in the command line. Solution: Add a test. (Dominique Pelle, closes #3742) Files: src/testdir/test_cmdline.vim *** ../vim-8.1.0667/src/testdir/test_cmdline.vim 2018-07-28 19:20:09.787586245 +0200 --- src/testdir/test_cmdline.vim 2018-12-31 21:02:00.554947899 +0100 *************** *** 581,584 **** --- 581,613 ---- 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& *** ../vim-8.1.0667/src/version.c 2018-12-31 20:05:50.783224479 +0100 --- src/version.c 2018-12-31 21:00:26.507734786 +0100 *************** *** 801,802 **** --- 801,804 ---- { /* Add new patch number below this line */ + /**/ + 668, /**/ -- You are only young once, but you can stay immature indefinitely. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///