diff options
Diffstat (limited to 'src/testdir/test_iminsert.vim')
-rw-r--r-- | src/testdir/test_iminsert.vim | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/testdir/test_iminsert.vim b/src/testdir/test_iminsert.vim index d49cd07cc..04c8a1599 100644 --- 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 |