Bram Moolenaar | 0c0590d | 2017-01-28 13:48:10 +0100 | [diff] [blame] | 1 | " Tests for Unicode manipulations |
Bram Moolenaar | 94722c5 | 2023-01-28 19:19:03 +0000 | [diff] [blame] | 2 | |
zeertzjq | 6cac770 | 2022-01-04 18:01:21 +0000 | [diff] [blame] | 3 | source check.vim |
Bram Moolenaar | 2912abb | 2019-03-29 14:16:42 +0100 | [diff] [blame] | 4 | source view_util.vim |
Yasuhiro Matsumoto | 2bc849f | 2023-01-10 16:03:08 +0000 | [diff] [blame] | 5 | source screendump.vim |
Bram Moolenaar | 0c0590d | 2017-01-28 13:48:10 +0100 | [diff] [blame] | 6 | |
| 7 | " Visual block Insert adjusts for multi-byte char |
| 8 | func Test_visual_block_insert() |
| 9 | new |
| 10 | call setline(1, ["aaa", "あああ", "bbb"]) |
| 11 | exe ":norm! gg0l\<C-V>jjIx\<Esc>" |
Bram Moolenaar | fc6cceb | 2022-01-20 12:22:35 +0000 | [diff] [blame] | 12 | call assert_equal(['axaa', ' xあああ', 'bxbb'], getline(1, '$')) |
Bram Moolenaar | 0c0590d | 2017-01-28 13:48:10 +0100 | [diff] [blame] | 13 | bwipeout! |
| 14 | endfunc |
| 15 | |
Bram Moolenaar | 70ce8a1 | 2021-03-14 19:02:09 +0100 | [diff] [blame] | 16 | " Test for built-in functions strchars() and strcharlen() |
Bram Moolenaar | 0c0590d | 2017-01-28 13:48:10 +0100 | [diff] [blame] | 17 | func Test_strchars() |
| 18 | let inp = ["a", "あいa", "A\u20dd", "A\u20dd\u20dd", "\u20dd"] |
| 19 | let exp = [[1, 1, 1], [3, 3, 3], [2, 2, 1], [3, 3, 1], [1, 1, 1]] |
| 20 | for i in range(len(inp)) |
| 21 | call assert_equal(exp[i][0], strchars(inp[i])) |
Bram Moolenaar | f6ed61e | 2019-09-07 19:05:09 +0200 | [diff] [blame] | 22 | call assert_equal(exp[i][1], inp[i]->strchars(0)) |
Bram Moolenaar | 0c0590d | 2017-01-28 13:48:10 +0100 | [diff] [blame] | 23 | call assert_equal(exp[i][2], strchars(inp[i], 1)) |
| 24 | endfor |
Bram Moolenaar | 70ce8a1 | 2021-03-14 19:02:09 +0100 | [diff] [blame] | 25 | |
| 26 | let exp = [1, 3, 1, 1, 1] |
| 27 | for i in range(len(inp)) |
| 28 | call assert_equal(exp[i], inp[i]->strcharlen()) |
| 29 | call assert_equal(exp[i], strcharlen(inp[i])) |
| 30 | endfor |
| 31 | |
zeertzjq | 8cf5137 | 2023-05-08 15:31:38 +0100 | [diff] [blame] | 32 | call assert_fails("call strchars('abc', 2)", ['E1023:', 'E1023:']) |
| 33 | call assert_fails("call strchars('abc', -1)", ['E1023:', 'E1023:']) |
| 34 | call assert_fails("call strchars('abc', {})", ['E728:', 'E728:']) |
| 35 | call assert_fails("call strchars('abc', [])", ['E745:', 'E745:']) |
Bram Moolenaar | 0c0590d | 2017-01-28 13:48:10 +0100 | [diff] [blame] | 36 | endfunc |
| 37 | |
| 38 | " Test for customlist completion |
Bram Moolenaar | 1e11536 | 2019-01-09 23:01:02 +0100 | [diff] [blame] | 39 | func CustomComplete1(lead, line, pos) |
Bram Moolenaar | 0c0590d | 2017-01-28 13:48:10 +0100 | [diff] [blame] | 40 | return ['あ', 'い'] |
Bram Moolenaar | 1e11536 | 2019-01-09 23:01:02 +0100 | [diff] [blame] | 41 | endfunc |
Bram Moolenaar | 0c0590d | 2017-01-28 13:48:10 +0100 | [diff] [blame] | 42 | |
Bram Moolenaar | 1e11536 | 2019-01-09 23:01:02 +0100 | [diff] [blame] | 43 | func CustomComplete2(lead, line, pos) |
Bram Moolenaar | 0c0590d | 2017-01-28 13:48:10 +0100 | [diff] [blame] | 44 | return ['あたし', 'あたま', 'あたりめ'] |
Bram Moolenaar | 1e11536 | 2019-01-09 23:01:02 +0100 | [diff] [blame] | 45 | endfunc |
Bram Moolenaar | 0c0590d | 2017-01-28 13:48:10 +0100 | [diff] [blame] | 46 | |
Bram Moolenaar | 1e11536 | 2019-01-09 23:01:02 +0100 | [diff] [blame] | 47 | func CustomComplete3(lead, line, pos) |
Bram Moolenaar | 0c0590d | 2017-01-28 13:48:10 +0100 | [diff] [blame] | 48 | return ['Nこ', 'Nん', 'Nぶ'] |
Bram Moolenaar | 1e11536 | 2019-01-09 23:01:02 +0100 | [diff] [blame] | 49 | endfunc |
Bram Moolenaar | 0c0590d | 2017-01-28 13:48:10 +0100 | [diff] [blame] | 50 | |
| 51 | func Test_customlist_completion() |
| 52 | command -nargs=1 -complete=customlist,CustomComplete1 Test1 echo |
| 53 | call feedkeys(":Test1 \<C-L>\<C-B>\"\<CR>", 'itx') |
| 54 | call assert_equal('"Test1 ', getreg(':')) |
| 55 | |
| 56 | command -nargs=1 -complete=customlist,CustomComplete2 Test2 echo |
| 57 | call feedkeys(":Test2 \<C-L>\<C-B>\"\<CR>", 'itx') |
| 58 | call assert_equal('"Test2 あた', getreg(':')) |
| 59 | |
| 60 | command -nargs=1 -complete=customlist,CustomComplete3 Test3 echo |
| 61 | call feedkeys(":Test3 \<C-L>\<C-B>\"\<CR>", 'itx') |
| 62 | call assert_equal('"Test3 N', getreg(':')) |
| 63 | |
| 64 | call garbagecollect(1) |
zeertzjq | a59e031 | 2024-04-15 19:14:38 +0200 | [diff] [blame] | 65 | delcommand Test1 |
| 66 | delcommand Test2 |
| 67 | delcommand Test3 |
Bram Moolenaar | 0c0590d | 2017-01-28 13:48:10 +0100 | [diff] [blame] | 68 | endfunc |
| 69 | |
| 70 | " Yank one 3 byte character and check the mark columns. |
| 71 | func Test_getvcol() |
| 72 | new |
| 73 | call setline(1, "x\u2500x") |
| 74 | normal 0lvy |
| 75 | call assert_equal(2, col("'[")) |
| 76 | call assert_equal(4, col("']")) |
| 77 | call assert_equal(2, virtcol("'[")) |
| 78 | call assert_equal(2, virtcol("']")) |
| 79 | endfunc |
Bram Moolenaar | 2912abb | 2019-03-29 14:16:42 +0100 | [diff] [blame] | 80 | |
Bram Moolenaar | 9d40128 | 2019-04-06 13:18:12 +0200 | [diff] [blame] | 81 | func Test_list2str_str2list_utf8() |
| 82 | " One Unicode codepoint |
| 83 | let s = "\u3042\u3044" |
| 84 | let l = [0x3042, 0x3044] |
| 85 | call assert_equal(l, str2list(s, 1)) |
| 86 | call assert_equal(s, list2str(l, 1)) |
| 87 | if &enc ==# 'utf-8' |
| 88 | call assert_equal(str2list(s), str2list(s, 1)) |
| 89 | call assert_equal(list2str(l), list2str(l, 1)) |
| 90 | endif |
| 91 | |
| 92 | " With composing characters |
| 93 | let s = "\u304b\u3099\u3044" |
| 94 | let l = [0x304b, 0x3099, 0x3044] |
| 95 | call assert_equal(l, str2list(s, 1)) |
Bram Moolenaar | 02b3111 | 2019-08-31 22:16:38 +0200 | [diff] [blame] | 96 | call assert_equal(s, l->list2str(1)) |
Bram Moolenaar | 9d40128 | 2019-04-06 13:18:12 +0200 | [diff] [blame] | 97 | if &enc ==# 'utf-8' |
| 98 | call assert_equal(str2list(s), str2list(s, 1)) |
| 99 | call assert_equal(list2str(l), list2str(l, 1)) |
| 100 | endif |
| 101 | |
| 102 | " Null list is the same as an empty list |
| 103 | call assert_equal('', list2str([])) |
| 104 | call assert_equal('', list2str(test_null_list())) |
| 105 | endfunc |
| 106 | |
| 107 | func Test_list2str_str2list_latin1() |
| 108 | " When 'encoding' is not multi-byte can still get utf-8 string. |
| 109 | " But we need to create the utf-8 string while 'encoding' is utf-8. |
| 110 | let s = "\u3042\u3044" |
| 111 | let l = [0x3042, 0x3044] |
| 112 | |
| 113 | let save_encoding = &encoding |
| 114 | set encoding=latin1 |
Bram Moolenaar | 94722c5 | 2023-01-28 19:19:03 +0000 | [diff] [blame] | 115 | |
Bram Moolenaar | 9d40128 | 2019-04-06 13:18:12 +0200 | [diff] [blame] | 116 | let lres = str2list(s, 1) |
| 117 | let sres = list2str(l, 1) |
Bram Moolenaar | 0e05de4 | 2020-03-25 22:23:46 +0100 | [diff] [blame] | 118 | call assert_equal([65, 66, 67], str2list("ABC")) |
Bram Moolenaar | 9d40128 | 2019-04-06 13:18:12 +0200 | [diff] [blame] | 119 | |
Bram Moolenaar | 08f4157 | 2020-04-20 16:50:00 +0200 | [diff] [blame] | 120 | " Try converting a list to a string in latin-1 encoding |
| 121 | call assert_equal([1, 2, 3], str2list(list2str([1, 2, 3]))) |
| 122 | |
Bram Moolenaar | 9d40128 | 2019-04-06 13:18:12 +0200 | [diff] [blame] | 123 | let &encoding = save_encoding |
| 124 | call assert_equal(l, lres) |
| 125 | call assert_equal(s, sres) |
| 126 | endfunc |
| 127 | |
Bram Moolenaar | 2912abb | 2019-03-29 14:16:42 +0100 | [diff] [blame] | 128 | func Test_screenchar_utf8() |
| 129 | new |
| 130 | |
Bram Moolenaar | 94722c5 | 2023-01-28 19:19:03 +0000 | [diff] [blame] | 131 | " 1-cell, with composing characters |
Bram Moolenaar | 2912abb | 2019-03-29 14:16:42 +0100 | [diff] [blame] | 132 | call setline(1, ["ABC\u0308"]) |
| 133 | redraw |
| 134 | call assert_equal([0x0041], screenchars(1, 1)) |
Bram Moolenaar | 196b466 | 2019-09-06 21:34:30 +0200 | [diff] [blame] | 135 | call assert_equal([0x0042], 1->screenchars(2)) |
Bram Moolenaar | 2912abb | 2019-03-29 14:16:42 +0100 | [diff] [blame] | 136 | call assert_equal([0x0043, 0x0308], screenchars(1, 3)) |
| 137 | call assert_equal("A", screenstring(1, 1)) |
| 138 | call assert_equal("B", screenstring(1, 2)) |
| 139 | call assert_equal("C\u0308", screenstring(1, 3)) |
| 140 | |
zeertzjq | 47eec67 | 2023-06-01 20:26:55 +0100 | [diff] [blame] | 141 | " 1-cell, with 6 composing characters |
| 142 | set maxcombine=6 |
| 143 | call setline(1, ["ABC" .. repeat("\u0308", 6)]) |
| 144 | redraw |
| 145 | call assert_equal([0x0041], screenchars(1, 1)) |
| 146 | call assert_equal([0x0042], 1->screenchars(2)) |
| 147 | " This should not use uninitialized memory |
| 148 | call assert_equal([0x0043] + repeat([0x0308], 6), screenchars(1, 3)) |
| 149 | call assert_equal("A", screenstring(1, 1)) |
| 150 | call assert_equal("B", screenstring(1, 2)) |
| 151 | call assert_equal("C" .. repeat("\u0308", 6), screenstring(1, 3)) |
| 152 | set maxcombine& |
| 153 | |
Bram Moolenaar | 94722c5 | 2023-01-28 19:19:03 +0000 | [diff] [blame] | 154 | " 2-cells, with composing characters |
Bram Moolenaar | 2912abb | 2019-03-29 14:16:42 +0100 | [diff] [blame] | 155 | let text = "\u3042\u3044\u3046\u3099" |
| 156 | call setline(1, text) |
| 157 | redraw |
| 158 | call assert_equal([0x3042], screenchars(1, 1)) |
| 159 | call assert_equal([0], screenchars(1, 2)) |
| 160 | call assert_equal([0x3044], screenchars(1, 3)) |
| 161 | call assert_equal([0], screenchars(1, 4)) |
| 162 | call assert_equal([0x3046, 0x3099], screenchars(1, 5)) |
| 163 | |
| 164 | call assert_equal("\u3042", screenstring(1, 1)) |
| 165 | call assert_equal("", screenstring(1, 2)) |
| 166 | call assert_equal("\u3044", screenstring(1, 3)) |
| 167 | call assert_equal("", screenstring(1, 4)) |
| 168 | call assert_equal("\u3046\u3099", screenstring(1, 5)) |
| 169 | |
Bram Moolenaar | 48aed08 | 2019-03-30 15:44:17 +0100 | [diff] [blame] | 170 | call assert_equal([text . ' '], ScreenLines(1, 8)) |
Bram Moolenaar | 2912abb | 2019-03-29 14:16:42 +0100 | [diff] [blame] | 171 | |
| 172 | bwipe! |
| 173 | endfunc |
Bram Moolenaar | 0e05de4 | 2020-03-25 22:23:46 +0100 | [diff] [blame] | 174 | |
Bram Moolenaar | 08aac3c | 2020-08-28 21:04:24 +0200 | [diff] [blame] | 175 | func Test_setcellwidths() |
zeertzjq | 05aacec | 2024-04-14 18:52:49 +0200 | [diff] [blame] | 176 | new |
Bram Moolenaar | 08aac3c | 2020-08-28 21:04:24 +0200 | [diff] [blame] | 177 | call setcellwidths([ |
| 178 | \ [0x1330, 0x1330, 2], |
Bram Moolenaar | 08aac3c | 2020-08-28 21:04:24 +0200 | [diff] [blame] | 179 | \ [9999, 10000, 1], |
Bram Moolenaar | b06a6d5 | 2020-08-28 23:27:20 +0200 | [diff] [blame] | 180 | \ [0x1337, 0x1339, 2], |
Bram Moolenaar | 08aac3c | 2020-08-28 21:04:24 +0200 | [diff] [blame] | 181 | \]) |
| 182 | |
| 183 | call assert_equal(2, strwidth("\u1330")) |
| 184 | call assert_equal(1, strwidth("\u1336")) |
| 185 | call assert_equal(2, strwidth("\u1337")) |
| 186 | call assert_equal(2, strwidth("\u1339")) |
| 187 | call assert_equal(1, strwidth("\u133a")) |
| 188 | |
K.Takata | 7193323 | 2023-01-20 16:00:55 +0000 | [diff] [blame] | 189 | for aw in ['single', 'double'] |
| 190 | exe 'set ambiwidth=' . aw |
| 191 | " Handle \u0080 to \u009F as control chars even on MS-Windows. |
| 192 | set isprint=@,161-255 |
| 193 | |
| 194 | call setcellwidths([]) |
| 195 | " Control chars |
| 196 | call assert_equal(4, strwidth("\u0081")) |
| 197 | call assert_equal(6, strwidth("\uFEFF")) |
| 198 | " Ambiguous width chars |
| 199 | call assert_equal((aw == 'single') ? 1 : 2, strwidth("\u00A1")) |
| 200 | call assert_equal((aw == 'single') ? 1 : 2, strwidth("\u2010")) |
| 201 | |
| 202 | call setcellwidths([[0x81, 0x81, 1], [0xA1, 0xA1, 1], |
| 203 | \ [0x2010, 0x2010, 1], [0xFEFF, 0xFEFF, 1]]) |
| 204 | " Control chars |
| 205 | call assert_equal(4, strwidth("\u0081")) |
| 206 | call assert_equal(6, strwidth("\uFEFF")) |
| 207 | " Ambiguous width chars |
| 208 | call assert_equal(1, strwidth("\u00A1")) |
| 209 | call assert_equal(1, strwidth("\u2010")) |
| 210 | |
| 211 | call setcellwidths([[0x81, 0x81, 2], [0xA1, 0xA1, 2], |
| 212 | \ [0x2010, 0x2010, 2], [0xFEFF, 0xFEFF, 2]]) |
| 213 | " Control chars |
| 214 | call assert_equal(4, strwidth("\u0081")) |
| 215 | call assert_equal(6, strwidth("\uFEFF")) |
| 216 | " Ambiguous width chars |
| 217 | call assert_equal(2, strwidth("\u00A1")) |
| 218 | call assert_equal(2, strwidth("\u2010")) |
zeertzjq | 05aacec | 2024-04-14 18:52:49 +0200 | [diff] [blame] | 219 | |
| 220 | call setcellwidths([]) |
| 221 | call setline(1, repeat("\u2103", 10)) |
| 222 | normal! $ |
| 223 | redraw |
| 224 | call assert_equal((aw == 'single') ? 10 : 19, wincol()) |
| 225 | call setcellwidths([[0x2103, 0x2103, 1]]) |
| 226 | redraw |
| 227 | call assert_equal(10, wincol()) |
| 228 | call setcellwidths([[0x2103, 0x2103, 2]]) |
| 229 | redraw |
| 230 | call assert_equal(19, wincol()) |
K.Takata | 7193323 | 2023-01-20 16:00:55 +0000 | [diff] [blame] | 231 | endfor |
| 232 | set ambiwidth& isprint& |
| 233 | |
Bram Moolenaar | 08aac3c | 2020-08-28 21:04:24 +0200 | [diff] [blame] | 234 | call setcellwidths([]) |
| 235 | |
Bram Moolenaar | d83392a | 2022-09-01 12:22:46 +0100 | [diff] [blame] | 236 | call assert_fails('call setcellwidths(1)', 'E1211:') |
Bram Moolenaar | 08aac3c | 2020-08-28 21:04:24 +0200 | [diff] [blame] | 237 | |
| 238 | call assert_fails('call setcellwidths([1, 2, 0])', 'E1109:') |
| 239 | |
| 240 | call assert_fails('call setcellwidths([[0x101]])', 'E1110:') |
| 241 | call assert_fails('call setcellwidths([[0x101, 0x102]])', 'E1110:') |
| 242 | call assert_fails('call setcellwidths([[0x101, 0x102, 1, 4]])', 'E1110:') |
| 243 | call assert_fails('call setcellwidths([["a"]])', 'E1110:') |
| 244 | |
| 245 | call assert_fails('call setcellwidths([[0x102, 0x101, 1]])', 'E1111:') |
| 246 | |
| 247 | call assert_fails('call setcellwidths([[0x101, 0x102, 0]])', 'E1112:') |
| 248 | call assert_fails('call setcellwidths([[0x101, 0x102, 3]])', 'E1112:') |
| 249 | |
| 250 | call assert_fails('call setcellwidths([[0x111, 0x122, 1], [0x115, 0x116, 2]])', 'E1113:') |
| 251 | call assert_fails('call setcellwidths([[0x111, 0x122, 1], [0x122, 0x123, 2]])', 'E1113:') |
| 252 | |
| 253 | call assert_fails('call setcellwidths([[0x33, 0x44, 2]])', 'E1114:') |
zeertzjq | 94358a1 | 2021-10-20 11:01:15 +0100 | [diff] [blame] | 254 | |
| 255 | set listchars=tab:--\\u2192 |
| 256 | call assert_fails('call setcellwidths([[0x2192, 0x2192, 2]])', 'E834:') |
| 257 | |
| 258 | set fillchars=stl:\\u2501 |
| 259 | call assert_fails('call setcellwidths([[0x2501, 0x2501, 2]])', 'E835:') |
| 260 | |
| 261 | set listchars& |
| 262 | set fillchars& |
| 263 | call setcellwidths([]) |
zeertzjq | 05aacec | 2024-04-14 18:52:49 +0200 | [diff] [blame] | 264 | bwipe! |
Bram Moolenaar | 08aac3c | 2020-08-28 21:04:24 +0200 | [diff] [blame] | 265 | endfunc |
| 266 | |
Kota Kato | 66bb9ae | 2023-01-17 18:31:56 +0000 | [diff] [blame] | 267 | func Test_getcellwidths() |
| 268 | call setcellwidths([]) |
| 269 | call assert_equal([], getcellwidths()) |
| 270 | |
| 271 | let widthlist = [ |
| 272 | \ [0x1330, 0x1330, 2], |
| 273 | \ [9999, 10000, 1], |
| 274 | \ [0x1337, 0x1339, 2], |
| 275 | \] |
| 276 | let widthlistsorted = [ |
| 277 | \ [0x1330, 0x1330, 2], |
| 278 | \ [0x1337, 0x1339, 2], |
| 279 | \ [9999, 10000, 1], |
| 280 | \] |
| 281 | call setcellwidths(widthlist) |
| 282 | call assert_equal(widthlistsorted, getcellwidths()) |
| 283 | |
| 284 | call setcellwidths([]) |
| 285 | endfunc |
| 286 | |
Yasuhiro Matsumoto | 2bc849f | 2023-01-10 16:03:08 +0000 | [diff] [blame] | 287 | func Test_setcellwidths_dump() |
| 288 | CheckRunVimInTerminal |
| 289 | |
| 290 | let lines =<< trim END |
| 291 | call setline(1, "\ue5ffDesktop") |
| 292 | END |
| 293 | call writefile(lines, 'XCellwidths', 'D') |
| 294 | let buf = RunVimInTerminal('-S XCellwidths', {'rows': 6}) |
| 295 | call VerifyScreenDump(buf, 'Test_setcellwidths_dump_1', {}) |
| 296 | |
| 297 | call term_sendkeys(buf, ":call setcellwidths([[0xe5ff, 0xe5ff, 2]])\<CR>") |
| 298 | call VerifyScreenDump(buf, 'Test_setcellwidths_dump_2', {}) |
| 299 | |
| 300 | call StopVimInTerminal(buf) |
| 301 | endfunc |
| 302 | |
zeertzjq | a59e031 | 2024-04-15 19:14:38 +0200 | [diff] [blame] | 303 | " For some reason this test causes Test_customlist_completion() to fail on CI, |
| 304 | " so run it as the last test. |
| 305 | func Test_zz_ambiwidth_hl_dump() |
| 306 | CheckRunVimInTerminal |
| 307 | |
| 308 | let lines =<< trim END |
| 309 | call setline(1, [repeat("\u2103", 60), repeat("\u2103", 60)]) |
| 310 | set ambiwidth=single cursorline list display=lastline |
| 311 | END |
| 312 | call writefile(lines, 'XAmbiwidthHl', 'D') |
| 313 | let buf = RunVimInTerminal('-S XAmbiwidthHl', {'rows': 6, 'cols': 50}) |
| 314 | call VerifyScreenDump(buf, 'Test_ambiwidth_hl_dump_1', {}) |
| 315 | |
| 316 | call term_sendkeys(buf, ":set ambiwidth=double\<CR>") |
| 317 | call term_sendkeys(buf, ":echo\<CR>") |
| 318 | call VerifyScreenDump(buf, 'Test_ambiwidth_hl_dump_2', {}) |
| 319 | |
| 320 | call term_sendkeys(buf, ":set ambiwidth=single\<CR>") |
| 321 | call term_sendkeys(buf, ":echo\<CR>") |
| 322 | call VerifyScreenDump(buf, 'Test_ambiwidth_hl_dump_1', {}) |
| 323 | |
| 324 | if 0 " Enable after #14539 is fixed |
| 325 | call term_sendkeys(buf, ":call setcellwidths([[0x2103, 0x2103, 2]])\<CR>") |
| 326 | call term_sendkeys(buf, ":echo\<CR>") |
| 327 | call VerifyScreenDump(buf, 'Test_ambiwidth_hl_dump_2', {}) |
| 328 | |
| 329 | call term_sendkeys(buf, ":call setcellwidths([[0x2103, 0x2103, 1]])\<CR>") |
| 330 | call term_sendkeys(buf, ":echo\<CR>") |
| 331 | call VerifyScreenDump(buf, 'Test_ambiwidth_hl_dump_1', {}) |
| 332 | endif |
| 333 | |
| 334 | call StopVimInTerminal(buf) |
| 335 | endfunc |
| 336 | |
Bram Moolenaar | 1cbfc99 | 2020-12-02 12:37:37 +0100 | [diff] [blame] | 337 | func Test_print_overlong() |
| 338 | " Text with more composing characters than MB_MAXBYTES. |
| 339 | new |
| 340 | call setline(1, 'axxxxxxxxxxxxxxxxxxxxxxxxxxxxxx') |
| 341 | s/x/\=nr2char(1629)/g |
| 342 | print |
| 343 | bwipe! |
| 344 | endfunc |
| 345 | |
Bram Moolenaar | 0e05de4 | 2020-03-25 22:23:46 +0100 | [diff] [blame] | 346 | " vim: shiftwidth=2 sts=2 expandtab |