blob: 1156342e342d04c1cbc51b737011df704ba34af4 [file] [log] [blame]
Bram Moolenaar2a5868a2014-08-16 19:45:02 +02001Tests for Unicode manipulations vim: set ft=vim :
2
3STARTTEST
4:so small.vim
5:set encoding=utf-8
6:" Visual block Insert adjusts for multi-byte char
7:new
8:call setline(1, ["aaa", "あああ", "bbb"])
9:exe ":norm! gg0l\<C-V>jjIx\<Esc>"
10:let r = getline(1, '$')
11:
12:bwipeout!
13:$put=r
Bram Moolenaar641e48c2015-06-25 16:09:26 +020014:" Test for built-in function strchars()
15:for str in ["a", "あいa", "A\u20dd", "A\u20dd\u20dd", "\u20dd"]
16: $put=strchars(str)
17: $put=strchars(str, 0)
18: $put=strchars(str, 1)
19:endfor
Bram Moolenaar4f8fa162015-11-19 19:00:05 +010020:" Test for customlist completion
21:function! CustomComplete1(lead, line, pos)
22: return ['あ', 'い']
23:endfunction
24:command -nargs=1 -complete=customlist,CustomComplete1 Test1 :
25:call feedkeys(":Test1 \<C-L>'\<C-B>$put='\<CR>", 't')
26:
27:function! CustomComplete2(lead, line, pos)
28: return ['あたし', 'あたま', 'あたりめ']
29:endfunction
30:command -nargs=1 -complete=customlist,CustomComplete2 Test2 :
31:call feedkeys(":Test2 \<C-L>'\<C-B>$put='\<CR>", 't')
32:
33:function! CustomComplete3(lead, line, pos)
34: return ['Nこ', 'Nん', 'Nぶ']
35:endfunction
36:command -nargs=1 -complete=customlist,CustomComplete3 Test3 :
37:call feedkeys(":Test3 \<C-L>'\<C-B>$put='\<CR>", 't')
38:
Bram Moolenaar2a5868a2014-08-16 19:45:02 +020039:call garbagecollect(1)
40:/^start:/,$wq! test.out
41ENDTEST
42
43start: