Mercurial > vim
comparison src/testdir/test_cmdline.vim @ 28119:57ea74314c1b v8.2.4584
patch 8.2.4584: error for using autoload function in custom completion
Commit: https://github.com/vim/vim/commit/da6d42c35a68610af872551b03077047258a7551
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 17 11:46:55 2022 +0000
patch 8.2.4584: error for using autoload function in custom completion
Problem: Error for using autoload function in custom completion.
Solution: Do not check for errors when using an autoload function.
(closes #9962)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 17 Mar 2022 13:00:07 +0100 |
parents | 06535d568f74 |
children | 4765d97b4d8b |
comparison
equal
deleted
inserted
replaced
28118:9f0aed0d75e2 | 28119:57ea74314c1b |
---|---|
1825 " Test with latin1 encoding | 1825 " Test with latin1 encoding |
1826 let save_encoding = &encoding | 1826 let save_encoding = &encoding |
1827 set encoding=latin1 | 1827 set encoding=latin1 |
1828 call Wildmode_tests() | 1828 call Wildmode_tests() |
1829 let &encoding = save_encoding | 1829 let &encoding = save_encoding |
1830 endfunc | |
1831 | |
1832 func Test_custom_complete_autoload() | |
1833 call mkdir('Xdir/autoload', 'p') | |
1834 let save_rtp = &rtp | |
1835 exe 'set rtp=' .. getcwd() .. '/Xdir' | |
1836 let lines =<< trim END | |
1837 func vim8#Complete(a, c, p) | |
1838 return "oneA\noneB\noneC" | |
1839 endfunc | |
1840 END | |
1841 call writefile(lines, 'Xdir/autoload/vim8.vim') | |
1842 | |
1843 command -nargs=1 -complete=custom,vim8#Complete MyCmd | |
1844 set nowildmenu | |
1845 set wildmode=full,list | |
1846 call feedkeys(":MyCmd \<C-A>\<C-B>\"\<CR>", 'xt') | |
1847 call assert_equal('"MyCmd oneA oneB oneC', @:) | |
1848 | |
1849 let &rtp = save_rtp | |
1850 set wildmode& wildmenu& | |
1851 delcommand MyCmd | |
1852 call delete('Xdir', 'rf') | |
1830 endfunc | 1853 endfunc |
1831 | 1854 |
1832 " Test for interrupting the command-line completion | 1855 " Test for interrupting the command-line completion |
1833 func Test_interrupt_compl() | 1856 func Test_interrupt_compl() |
1834 func F(lead, cmdl, p) | 1857 func F(lead, cmdl, p) |