view src/testdir/test_iminsert.vim @ 12930:e2612e03d46f v8.0.1341

patch 8.0.1341: 'imactivatefunc' test fails on MS-Windows commit https://github.com/vim/vim/commit/be5d998d0ea2226f1f7180c32b19df17ad674853 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 25 17:58:28 2017 +0100 patch 8.0.1341: 'imactivatefunc' test fails on MS-Windows Problem: 'imactivatefunc' test fails on MS-Windows. Solution: Skip the text.
author Christian Brabandt <cb@256bit.org>
date Sat, 25 Nov 2017 18:00:06 +0100
parents 327e1264b9bf
children c53a80f39a52
line wrap: on
line source

if !has('multi_byte')
  finish
endif

source view_util.vim

let s:imactivatefunc_called = 0
let s:imstatusfunc_called = 0

func IM_activatefunc(active)
  let s:imactivatefunc_called = 1
endfunc

func IM_statusfunc()
  let s:imstatusfunc_called = 1
  return 0
endfunc

func Test_iminsert2()
  if has('gui_win32')
    return
  endif
  set imactivatefunc=IM_activatefunc
  set imstatusfunc=IM_statusfunc
  set iminsert=2
  normal! i
  set iminsert=0
  set imactivatefunc=
  set imstatusfunc=
  call assert_equal(1, s:imactivatefunc_called)
  call assert_equal(1, s:imstatusfunc_called)
endfunc