Bram Moolenaar | 6315a9a | 2017-11-25 15:20:02 +0100 | [diff] [blame] | 1 | if !has('multi_byte') |
| 2 | finish |
| 3 | endif |
| 4 | |
| 5 | source view_util.vim |
| 6 | |
| 7 | let s:imactivatefunc_called = 0 |
| 8 | let s:imstatusfunc_called = 0 |
| 9 | |
| 10 | func IM_activatefunc(active) |
| 11 | let s:imactivatefunc_called = 1 |
| 12 | endfunc |
| 13 | |
| 14 | func IM_statusfunc() |
| 15 | let s:imstatusfunc_called = 1 |
| 16 | return 0 |
| 17 | endfunc |
| 18 | |
| 19 | func Test_iminsert2() |
Bram Moolenaar | be5d998 | 2017-11-25 17:58:28 +0100 | [diff] [blame] | 20 | if has('gui_win32') |
| 21 | return |
| 22 | endif |
Bram Moolenaar | 6315a9a | 2017-11-25 15:20:02 +0100 | [diff] [blame] | 23 | set imactivatefunc=IM_activatefunc |
| 24 | set imstatusfunc=IM_statusfunc |
| 25 | set iminsert=2 |
| 26 | normal! i |
| 27 | set iminsert=0 |
| 28 | set imactivatefunc= |
| 29 | set imstatusfunc= |
| 30 | call assert_equal(1, s:imactivatefunc_called) |
| 31 | call assert_equal(1, s:imstatusfunc_called) |
| 32 | endfunc |