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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1079
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.1079
Problem: No need for a separate ScreenLinesUtf8() test function.
Solution: Get the composing characters with ScreenLines().
Files: src/testdir/view_util.vim, src/testdir/test_listchars.vim,
src/testdir/test_utf8.vim
*** ../vim-8.1.1078/src/testdir/view_util.vim 2019-03-29 14:16:34.142861770 +0100
--- src/testdir/view_util.vim 2019-03-30 15:42:00.064646502 +0100
***************
*** 5,33 ****
finish
endif
- " Get text on the screen, without composing characters.
- " ScreenLines(lnum, width) or
- " ScreenLines([start, end], width)
- function! ScreenLines(lnum, width) abort
- redraw!
- if type(a:lnum) == v:t_list
- let start = a:lnum[0]
- let end = a:lnum[1]
- else
- let start = a:lnum
- let end = a:lnum
- endif
- let lines = []
- for l in range(start, end)
- let lines += [join(map(range(1, a:width), 'nr2char(screenchar(l, v:val))'), '')]
- endfor
- return lines
- endfunction
-
" Get text on the screen, including composing characters.
" ScreenLines(lnum, width) or
" ScreenLines([start, end], width)
! function! ScreenLinesUtf8(lnum, width) abort
redraw!
if type(a:lnum) == v:t_list
let start = a:lnum[0]
--- 5,14 ----
finish
endif
" Get text on the screen, including composing characters.
" ScreenLines(lnum, width) or
" ScreenLines([start, end], width)
! function! ScreenLines(lnum, width) abort
redraw!
if type(a:lnum) == v:t_list
let start = a:lnum[0]
*** ../vim-8.1.1078/src/testdir/test_listchars.vim 2019-03-30 15:34:42.715472004 +0100
--- src/testdir/test_listchars.vim 2019-03-30 15:41:24.208877625 +0100
***************
*** 130,136 ****
\ ]
redraw!
call cursor(1, 1)
! let got = ScreenLinesUtf8(1, virtcol('$'))
bw!
call assert_equal(expected, got)
let &encoding=oldencoding
--- 130,136 ----
\ ]
redraw!
call cursor(1, 1)
! let got = ScreenLines(1, virtcol('$'))
bw!
call assert_equal(expected, got)
let &encoding=oldencoding
*** ../vim-8.1.1078/src/testdir/test_utf8.vim 2019-03-29 14:16:34.142861770 +0100
--- src/testdir/test_utf8.vim 2019-03-30 15:41:40.588772034 +0100
***************
*** 91,97 ****
call assert_equal("", screenstring(1, 4))
call assert_equal("\u3046\u3099", screenstring(1, 5))
! call assert_equal([text . ' '], ScreenLinesUtf8(1, 8))
bwipe!
endfunc
--- 91,97 ----
call assert_equal("", screenstring(1, 4))
call assert_equal("\u3046\u3099", screenstring(1, 5))
! call assert_equal([text . ' '], ScreenLines(1, 8))
bwipe!
endfunc
*** ../vim-8.1.1078/src/version.c 2019-03-30 15:34:42.715472004 +0100
--- src/version.c 2019-03-30 15:40:47.517114213 +0100
***************
*** 777,778 ****
--- 777,780 ----
{ /* Add new patch number below this line */
+ /**/
+ 1079,
/**/
--
hundred-and-one symptoms of being an internet addict:
159. You get excited whenever discussing your hard drive.
/// 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 ///
|