Mercurial > vim
comparison src/testdir/test_vim9_script.vim @ 21485:afc8cc1a291f v8.2.1293
patch 8.2.1293: Vim9: error when using vim9script in TextYankPost
Commit: https://github.com/vim/vim/commit/2d6b20d6a9a034b39f79a7dbb889fb5d859583ae
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 25 19:30:59 2020 +0200
patch 8.2.1293: Vim9: error when using vim9script in TextYankPost
Problem: Vim9: error when using vim9script in TextYankPost.
Solution: Use EX_LOCKOK instead of the EX_CMDWIN flag for command that can
be used when text is locked. (closes #6529)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 25 Jul 2020 19:45:04 +0200 |
parents | 90d859a402cc |
children | c7b2ce90c2de |
comparison
equal
deleted
inserted
replaced
21484:eeea3ab1fe04 | 21485:afc8cc1a291f |
---|---|
1706 let cmd_last = 'setline(1, "execute-var-var")' | 1706 let cmd_last = 'setline(1, "execute-var-var")' |
1707 execute cmd_first .. cmd_last | 1707 execute cmd_first .. cmd_last |
1708 assert_equal('execute-var-var', getline(1)) | 1708 assert_equal('execute-var-var', getline(1)) |
1709 bwipe! | 1709 bwipe! |
1710 | 1710 |
1711 let n = true | |
1712 execute 'echomsg' (n ? '"true"' : '"no"') | |
1713 assert_match('^true$', Screenline(&lines)) | |
1714 | |
1711 call CheckDefFailure(['execute xxx'], 'E1001:') | 1715 call CheckDefFailure(['execute xxx'], 'E1001:') |
1712 call CheckDefFailure(['execute "cmd"# comment'], 'E488:') | 1716 call CheckDefFailure(['execute "cmd"# comment'], 'E488:') |
1713 enddef | 1717 enddef |
1714 | 1718 |
1715 def Test_execute_cmd_vimscript() | 1719 def Test_execute_cmd_vimscript() |
2632 # this was giving an error for setting w:quickfix_title | 2636 # this was giving an error for setting w:quickfix_title |
2633 copen | 2637 copen |
2634 quit | 2638 quit |
2635 enddef | 2639 enddef |
2636 | 2640 |
2641 " test using a vim9script that is auto-loaded from an autocmd | |
2642 def Test_vim9_autoload() | |
2643 let lines =<< trim END | |
2644 vim9script | |
2645 def foo#test() | |
2646 echomsg getreg('"') | |
2647 enddef | |
2648 END | |
2649 | |
2650 mkdir('Xdir/autoload', 'p') | |
2651 writefile(lines, 'Xdir/autoload/foo.vim') | |
2652 let save_rtp = &rtp | |
2653 exe 'set rtp^=' .. getcwd() .. '/Xdir' | |
2654 augroup test | |
2655 autocmd TextYankPost * call foo#test() | |
2656 augroup END | |
2657 | |
2658 normal Y | |
2659 | |
2660 augroup test | |
2661 autocmd! | |
2662 augroup END | |
2663 delete('Xdir', 'rf') | |
2664 &rtp = save_rtp | |
2665 enddef | |
2666 | |
2637 " Keep this last, it messes up highlighting. | 2667 " Keep this last, it messes up highlighting. |
2638 def Test_substitute_cmd() | 2668 def Test_substitute_cmd() |
2639 new | 2669 new |
2640 setline(1, 'something') | 2670 setline(1, 'something') |
2641 :substitute(some(other( | 2671 :substitute(some(other( |