From 36803323253e336e0d4a6efaa61c8b647ef78eba Mon Sep 17 00:00:00 2001 From: watiko Date: Mon, 15 Feb 2016 23:43:27 +0900 Subject: 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 --- test/functional/legacy/utf8_spec.lua | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'test/functional/legacy/utf8_spec.lua') 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 '$put='") + + source([[ + function! CustomComplete2(lead, line, pos) + return ['あたし', 'あたま', 'あたりめ'] + endfunction + command -nargs=1 -complete=customlist,CustomComplete2 Test2 :]]) + feed(":Test2 '$put='") + + source([[ + function! CustomComplete3(lead, line, pos) + return ['Nこ', 'Nん', 'Nぶ'] + endfunction + command -nargs=1 -complete=customlist,CustomComplete3 Test3 :]]) + feed(":Test3 '$put='") + + expect([[ + + Test1 + Test2 あた + Test3 N]]) + end) end) -- cgit