comparison src/testdir/test_functions.vim @ 24838:3f9053c21765 v8.2.2957

patch 8.2.2957: using getchar() in Vim9 script is problematic Commit: https://github.com/vim/vim/commit/3a7503c34c65ed15cc08deb5b54aaf2ea51525b4 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jun 7 18:29:17 2021 +0200 patch 8.2.2957: using getchar() in Vim9 script is problematic Problem: Using getchar() in Vim9 script is problematic. Solution: Add getcharstr(). (closes https://github.com/vim/vim/issues/8343)
author Bram Moolenaar <Bram@vim.org>
date Mon, 07 Jun 2021 18:30:04 +0200
parents 5f8dd7b3ae41
children f67773e26cfa
comparison
equal deleted inserted replaced
24837:a9c9ff4fb89b 24838:3f9053c21765
1727 endfunc 1727 endfunc
1728 1728
1729 func Test_getchar() 1729 func Test_getchar()
1730 call feedkeys('a', '') 1730 call feedkeys('a', '')
1731 call assert_equal(char2nr('a'), getchar()) 1731 call assert_equal(char2nr('a'), getchar())
1732 call assert_equal(0, getchar(0))
1733 call assert_equal(0, getchar(1))
1734
1735 call feedkeys('a', '')
1736 call assert_equal('a', getcharstr())
1737 call assert_equal('', getcharstr(0))
1738 call assert_equal('', getcharstr(1))
1732 1739
1733 call setline(1, 'xxxx') 1740 call setline(1, 'xxxx')
1734 call test_setmouse(1, 3) 1741 call test_setmouse(1, 3)
1735 let v:mouse_win = 9 1742 let v:mouse_win = 9
1736 let v:mouse_winid = 9 1743 let v:mouse_winid = 9