Bram Moolenaar | 2a5868a | 2014-08-16 19:45:02 +0200 | [diff] [blame] | 1 | Tests for Unicode manipulations vim: set ft=vim : |
| 2 | |
| 3 | STARTTEST |
| 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 Moolenaar | 641e48c | 2015-06-25 16:09:26 +0200 | [diff] [blame] | 14 | :" 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 Moolenaar | 4f8fa16 | 2015-11-19 19:00:05 +0100 | [diff] [blame] | 20 | :" 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 Moolenaar | 2a5868a | 2014-08-16 19:45:02 +0200 | [diff] [blame] | 39 | :call garbagecollect(1) |
| 40 | :/^start:/,$wq! test.out |
| 41 | ENDTEST |
| 42 | |
| 43 | start: |