Mercurial > vim
diff src/testdir/test_iminsert.vim @ 20941:505d97ea54da v8.2.1022
patch 8.2.1022: various parts of code not covered by tests
Commit: https://github.com/vim/vim/commit/845e0ee59430eac07e74b6cb92020e420d17953d
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jun 20 16:05:32 2020 +0200
patch 8.2.1022: various parts of code not covered by tests
Problem: Various parts of code not covered by tests.
Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/6300)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 20 Jun 2020 16:15:04 +0200 |
parents | f70a3c1000bb |
children | 2d3cd9acf853 |
line wrap: on
line diff
--- a/src/testdir/test_iminsert.vim +++ b/src/testdir/test_iminsert.vim @@ -7,7 +7,7 @@ let s:imstatus_active = 0 func IM_activatefunc(active) let s:imactivatefunc_called = 1 -let s:imstatus_active = a:active + let s:imstatus_active = a:active endfunc func IM_statusfunc() @@ -83,4 +83,30 @@ func Test_lmap_in_insert_mode() close! endfunc +" Test for using CTRL-^ to toggle iminsert in insert mode +func Test_iminsert_toggle() + CheckGui + if has('win32') + CheckFeature multi_byte_ime + elseif !has('gui_mac') + CheckFeature xim + endif + if has('gui_running') && !has('win32') + " this works only in Win32 GUI version (for some reason) + return + endif + new + let save_imdisable = &imdisable + let save_iminsert = &iminsert + set noimdisable + set iminsert=0 + exe "normal i\<C-^>" + call assert_equal(2, &iminsert) + exe "normal i\<C-^>" + call assert_equal(0, &iminsert) + let &iminsert = save_iminsert + let &imdisable = save_imdisable + close! +endfunc + " vim: shiftwidth=2 sts=2 expandtab