To: vim-dev@vim.org Subject: Patch 6.1.352 (extra) Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.352 (extra, depends on 6.1.345) Problem: Win32: Crash when setting "imdisable" in _vimrc. Solution: Don't call IME functions when imm32.dll was not loaded (yet). Also add typecasts to avoid Compiler warnings for ImmAssociateContext() argument. Files: src/gui_w32.c *** ../vim61.351/src/gui_w32.c Thu Feb 20 21:29:10 2003 --- src/gui_w32.c Sat Feb 22 13:58:09 2003 *************** *** 1474,1502 **** im_set_active(int active) { HIMC hImc; ! static HIMC hImcOld = NULL; ! if (p_imdisable) { ! if (hImcOld == NULL) { ! hImcOld = pImmGetContext(s_hwnd); ! if (hImcOld) ! pImmAssociateContext(s_hwnd, NULL); } - active = FALSE; - } - else - if (hImcOld != NULL) - { - pImmAssociateContext(s_hwnd, hImcOld); - hImcOld = NULL; - } ! if (pImmGetContext && (hImc = pImmGetContext(s_hwnd))) ! { ! pImmSetOpenStatus(hImc, active); ! pImmReleaseContext(s_hwnd, hImc); } } --- 1471,1501 ---- im_set_active(int active) { HIMC hImc; ! static HIMC hImcOld = (HIMC)0; ! if (pImmGetContext) /* if NULL imm32.dll wasn't loaded (yet) */ { ! if (p_imdisable) { ! if (hImcOld == (HIMC)0) ! { ! hImcOld = pImmGetContext(s_hwnd); ! if (hImcOld) ! pImmAssociateContext(s_hwnd, (HIMC)0); ! } ! active = FALSE; ! } ! else if (hImcOld != (HIMC)0) ! { ! pImmAssociateContext(s_hwnd, hImcOld); ! hImcOld = (HIMC)0; } ! if (hImc = pImmGetContext(s_hwnd)) ! { ! pImmSetOpenStatus(hImc, active); ! pImmReleaseContext(s_hwnd, hImc); ! } } } *** ../vim61.351/src/version.c Fri Feb 21 22:25:48 2003 --- src/version.c Sat Feb 22 14:04:11 2003 *************** *** 608,609 **** --- 612,615 ---- { /* Add new patch number below this line */ + /**/ + 352, /**/ -- ARTHUR: I did say sorry about the `old woman,' but from the behind you looked-- DENNIS: What I object to is you automatically treat me like an inferior! ARTHUR: Well, I AM king... The Quest for the Holy Grail (Monty Python) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///