comparison src/testdir/test_vim9_import.vim @ 28461:938c174b8088 v8.2.4755

patch 8.2.4755: cannot use <SID>FuncRef in completion spec Commit: https://github.com/vim/vim/commit/12eb2eb4d78828513d91e04b0e69550ed37a5932 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Apr 15 22:57:09 2022 +0100 patch 8.2.4755: cannot use <SID>FuncRef in completion spec Problem: Cannot use <SID>FuncRef in completion spec. Solution: Dereference a function name in another way. (closes https://github.com/vim/vim/issues/10197)
author Bram Moolenaar <Bram@vim.org>
date Sat, 16 Apr 2022 00:00:03 +0200
parents 862068e9e2a7
children 35e24d9de858
comparison
equal deleted inserted replaced
28460:5bd8735b98a4 28461:938c174b8088
747 747
748 delcommand Cmd 748 delcommand Cmd
749 delete('Xscript.vim') 749 delete('Xscript.vim')
750 enddef 750 enddef
751 751
752 def Test_use_import_with_funcref_in_command_completion()
753 var lines =<< trim END
754 vim9script
755 export def Complete(..._): list<string>
756 return ['abcd']
757 enddef
758 END
759 writefile(lines, 'Xscript.vim')
760
761 lines =<< trim END
762 vim9script
763 import './Xscript.vim'
764
765 var Ref = Xscript.Complete
766 exe "command -nargs=1 -complete=customlist," .. expand('<SID>') .. "Ref Cmd echo 'ok'"
767 feedkeys(":Cmd ab\<Tab>\<C-B>#\<CR>", 'xnt')
768 assert_equal('#Cmd abcd', @:)
769 END
770 v9.CheckScriptSuccess(lines)
771
772 delcommand Cmd
773 delete('Xscript.vim')
774 enddef
775
752 def Test_use_autoload_import_in_insert_completion() 776 def Test_use_autoload_import_in_insert_completion()
753 mkdir('Xdir/autoload', 'p') 777 mkdir('Xdir/autoload', 'p')
754 var save_rtp = &rtp 778 var save_rtp = &rtp
755 exe 'set rtp^=' .. getcwd() .. '/Xdir' 779 exe 'set rtp^=' .. getcwd() .. '/Xdir'
756 780