diff options
author | watiko <service@mail.watiko.net> | 2016-02-15 23:43:27 +0900 |
---|---|---|
committer | watiko <service@mail.watiko.net> | 2016-02-16 00:15:52 +0900 |
commit | 36803323253e336e0d4a6efaa61c8b647ef78eba (patch) | |
tree | 3edc1f8364908c19a19282dc135333e25d2edac8 /test/functional/legacy/utf8_spec.lua | |
parent | 7609a96a35224be3d7f3ba77691f9115e0281b4e (diff) | |
download | rneovim-36803323253e336e0d4a6efaa61c8b647ef78eba.tar.gz rneovim-36803323253e336e0d4a6efaa61c8b647ef78eba.tar.bz2 rneovim-36803323253e336e0d4a6efaa61c8b647ef78eba.zip |
vim-patch:7.4.926
Problem: Completing the longest match doesn't work properly with multi-byte
characters.
Solution: When using multi-byte characters use another way to find the
longest match. (Hirohito Higashi)
https://github.com/vim/vim/commit/4f8fa1633cdfbd09a41160c8480fe67c198067e9
Diffstat (limited to 'test/functional/legacy/utf8_spec.lua')
-rw-r--r-- | test/functional/legacy/utf8_spec.lua | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/test/functional/legacy/utf8_spec.lua b/test/functional/legacy/utf8_spec.lua index c16b1c45f4..d2315b3590 100644 --- a/test/functional/legacy/utf8_spec.lua +++ b/test/functional/legacy/utf8_spec.lua @@ -4,9 +4,10 @@ local helpers = require('test.functional.helpers') local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert local execute, expect = helpers.execute, helpers.expect local eq, eval = helpers.eq, helpers.eval +local source = helpers.source describe('utf8', function() - setup(clear) + before_each(clear) it('is working', function() insert('start:') @@ -50,4 +51,33 @@ describe('utf8', function() eq(1, eval('strchars("\\u20dd", 0)')) eq(1, eval('strchars("\\u20dd", 1)')) end) + + it('customlist completion', function() + source([[ + function! CustomComplete1(lead, line, pos) + return ['あ', 'い'] + endfunction + command -nargs=1 -complete=customlist,CustomComplete1 Test1 :]]) + feed(":Test1 <C-L>'<C-B>$put='<CR>") + + source([[ + function! CustomComplete2(lead, line, pos) + return ['あたし', 'あたま', 'あたりめ'] + endfunction + command -nargs=1 -complete=customlist,CustomComplete2 Test2 :]]) + feed(":Test2 <C-L>'<C-B>$put='<CR>") + + source([[ + function! CustomComplete3(lead, line, pos) + return ['Nこ', 'Nん', 'Nぶ'] + endfunction + command -nargs=1 -complete=customlist,CustomComplete3 Test3 :]]) + feed(":Test3 <C-L>'<C-B>$put='<CR>") + + expect([[ + + Test1 + Test2 あた + Test3 N]]) + end) end) |