diff options
author | ii14 <59243201+ii14@users.noreply.github.com> | 2021-11-21 19:00:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-21 13:00:51 -0500 |
commit | 9d868317f9c6b9cf5ec4bcf0694d2934815d806d (patch) | |
tree | 9bfaf347f85289cfd923482c110c67174d4f73b4 /src/nvim/testdir | |
parent | 134a6385e2c5bd1d08027562640e07c0270cc3cd (diff) | |
download | rneovim-9d868317f9c6b9cf5ec4bcf0694d2934815d806d.tar.gz rneovim-9d868317f9c6b9cf5ec4bcf0694d2934815d806d.tar.bz2 rneovim-9d868317f9c6b9cf5ec4bcf0694d2934815d806d.zip |
vim-patch:8.2.3638: getcompletion() always passes zero as position (#16387)
Problem: getcompletion() always passes zero as position to custom
completion function.
Solution: Pass the pattern length. (closes vim/vim#9173)
https://github.com/vim/vim/commit/4785fe02bba14c4e0aede0fa425ca790a1cb98d7
Co-authored-by: ii14 <ii14@users.noreply.github.com>
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_cmdline.vim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index 98340d0ac6..75e17b47b8 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -428,14 +428,17 @@ func Test_getcompletion() call assert_equal([], l) func T(a, c, p) + let g:cmdline_compl_params = [a:a, a:c, a:p] return "oneA\noneB\noneC" endfunc command -nargs=1 -complete=custom,T MyCmd let l = getcompletion('MyCmd ', 'cmdline') call assert_equal(['oneA', 'oneB', 'oneC'], l) + call assert_equal(['', 'MyCmd ', 6], g:cmdline_compl_params) delcommand MyCmd delfunc T + unlet g:cmdline_compl_params " For others test if the name is recognized. let names = ['buffer', 'environment', 'file_in_path', 'mapping', 'tag', 'tag_listfiles', 'user'] |