diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2019-02-18 10:40:33 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-18 10:40:33 +0100 |
| commit | ece19b459c082eae05b5c480f6ee91181f002c02 (patch) | |
| tree | 50508d66759242e4b45f3f72520e31a61aed473c /src/nvim/testdir/test_cmdline.vim | |
| parent | 9cf600e702872ddae83c222d0a389f809879a212 (diff) | |
| parent | d595ca021dc4cd6e886759effdb1d4b89fe22b45 (diff) | |
| download | rneovim-ece19b459c082eae05b5c480f6ee91181f002c02.tar.gz rneovim-ece19b459c082eae05b5c480f6ee91181f002c02.tar.bz2 rneovim-ece19b459c082eae05b5c480f6ee91181f002c02.zip | |
Merge #9626 from janlazo/vim-8.1.0926
Diffstat (limited to 'src/nvim/testdir/test_cmdline.vim')
| -rw-r--r-- | src/nvim/testdir/test_cmdline.vim | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index 26f1dcc333..75832a798c 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -522,4 +522,33 @@ func Test_setcmdpos() call assert_equal(1, setcmdpos(3)) endfunc +func Test_cmdline_overstrike() + let encodings = has('multi_byte') ? [ '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\<home>\<right>\<right>ab\<right>\<insert>cd\<enter>", 'xt') + call assert_equal('"0ab1cd4', @:) + + " Test overstrike going beyond end of command line. + call feedkeys(":\"01234\<home>\<right>\<right>ab\<right>\<insert>cdefgh\<enter>", 'xt') + call assert_equal('"0ab1cdefgh', @:) + + " Test toggling insert/overstrike a few times. + call feedkeys(":\"01234\<home>\<right>ab\<right>\<insert>cd\<right>\<insert>ef\<enter>", 'xt') + call assert_equal('"ab0cd3ef4', @:) + endfor + + if has('multi_byte') + " Test overstrike with multi-byte characters. + call feedkeys(":\"テキストエディタ\<home>\<right>\<right>ab\<right>\<insert>cd\<enter>", 'xt') + call assert_equal('"テabキcdエディタ', @:) + endif + + let &encoding = encoding_save +endfunc + set cpo& |