1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0668
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
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\<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&
*** ../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 ///
|