Mercurial > vim
view src/testdir/test_utf8.in @ 8793:dda254280bab v7.4.1685
commit https://github.com/vim/vim/commit/7fed5c18f8577b75404b80d8b9a9907b1bbd27e4
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Mar 29 23:10:31 2016 +0200
patch 7.4.1685
Problem: There is no easy way to get all the information about a match.
Solution: Add matchstrpos(). (Ozaki Kiichi)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 29 Mar 2016 23:15:06 +0200 |
parents | b4b7b06c7951 |
children |
line wrap: on
line source
Tests for Unicode manipulations vim: set ft=vim : STARTTEST :so small.vim :set encoding=utf-8 :" :" Visual block Insert adjusts for multi-byte char :new :call setline(1, ["aaa", "あああ", "bbb"]) :exe ":norm! gg0l\<C-V>jjIx\<Esc>" :let r = getline(1, '$') :" :bwipeout! :$put=r :" :" Test for built-in function strchars() :for str in ["a", "あいa", "A\u20dd", "A\u20dd\u20dd", "\u20dd"] : $put=strchars(str) : $put=strchars(str, 0) : $put=strchars(str, 1) :endfor :" :" Test for customlist completion :function! CustomComplete1(lead, line, pos) : return ['あ', 'い'] :endfunction :command -nargs=1 -complete=customlist,CustomComplete1 Test1 echo :call feedkeys(":Test1 \<C-L>'\<C-B>$put='\<CR>", 'it') :" :function! CustomComplete2(lead, line, pos) : return ['あたし', 'あたま', 'あたりめ'] :endfunction :command -nargs=1 -complete=customlist,CustomComplete2 Test2 echo :call feedkeys(":Test2 \<C-L>'\<C-B>$put='\<CR>", 'it') :" :function! CustomComplete3(lead, line, pos) : return ['Nこ', 'Nん', 'Nぶ'] :endfunction :command -nargs=1 -complete=customlist,CustomComplete3 Test3 echo :call feedkeys(":Test3 \<C-L>'\<C-B>$put='\<CR>", 'it') :" :call garbagecollect(1) :/^start:/,$wq! test.out ENDTEST start: