To: vim-dev@vim.org Subject: Patch 6.1.223 (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.223 (extra) Problem: Win32: When IME is activated 'iminsert' is set, but it might never be reset when IME is disabled. (Muraoka Taro) All systems: 'iminsert' is set to 2 when leaving Insert mode, even when langmap is being used. (Peter Valach) Solution: Don't set "b_p_iminsert" in _OnImeNotify(). (Muraoka Taro) Don't store the status of the input method in 'iminsert' when 'iminsert' is one. Also for editing the command line and for arguments to Normal mode commands. Files: src/edit.c, src/ex_getln.c, src/gui_w32.c, src/normal.c *** ../vim61.222/src/edit.c Sun Oct 13 20:08:13 2002 --- src/edit.c Mon Oct 14 20:11:55 2002 *************** *** 338,343 **** --- 338,349 ---- */ curs_columns(TRUE); + /* + * Enable langmap or IME, indicated by 'iminsert'. + * Note that IME may enabled/disabled without us noticing here, thus the + * 'iminsert' value may not reflect what is actually used. It is updated + * when hitting . + */ if (curbuf->b_p_iminsert == B_IMODE_LMAP) State |= LANGMAP; #ifdef USE_IM_CONTROL *************** *** 843,849 **** if (map_to_exists_mode((char_u *)"", LANGMAP)) { /* ":lmap" mappings exists, Toggle use of ":lmap" mappings. */ ! if (curbuf->b_p_iminsert == B_IMODE_LMAP) { curbuf->b_p_iminsert = B_IMODE_NONE; State &= ~LANGMAP; --- 849,855 ---- if (map_to_exists_mode((char_u *)"", LANGMAP)) { /* ":lmap" mappings exists, Toggle use of ":lmap" mappings. */ ! if (State & LANGMAP) { curbuf->b_p_iminsert = B_IMODE_NONE; State &= ~LANGMAP; *************** *** 861,867 **** else { /* There are no ":lmap" mappings, toggle IM */ ! if (curbuf->b_p_iminsert == B_IMODE_IM) { curbuf->b_p_iminsert = B_IMODE_NONE; im_set_active(FALSE); --- 867,873 ---- else { /* There are no ":lmap" mappings, toggle IM */ ! if (im_get_status()) { curbuf->b_p_iminsert = B_IMODE_NONE; im_set_active(FALSE); *************** *** 5874,5881 **** #endif #ifdef USE_IM_CONTROL ! /* Disable IM to allow typing English directly for Normal mode commands. */ ! im_save_status(&curbuf->b_p_iminsert); im_set_active(FALSE); #endif --- 5880,5890 ---- #endif #ifdef USE_IM_CONTROL ! /* Disable IM to allow typing English directly for Normal mode commands. ! * When ":lmap" is enabled don't change 'iminsert' (IM can be enabled as ! * well). */ ! if (!(State & LANGMAP)) ! im_save_status(&curbuf->b_p_iminsert); im_set_active(FALSE); #endif *** ../vim61.222/src/ex_getln.c Sun Oct 13 20:08:14 2002 --- src/ex_getln.c Sun Oct 13 15:35:07 2002 *************** *** 1526,1532 **** State = save_State; #ifdef USE_IM_CONTROL ! if (b_im_ptr != NULL) im_save_status(b_im_ptr); im_set_active(FALSE); #endif --- 1526,1532 ---- State = save_State; #ifdef USE_IM_CONTROL ! if (b_im_ptr != NULL && *b_im_ptr != B_IMODE_LMAP) im_save_status(b_im_ptr); im_set_active(FALSE); #endif *** ../vim61.222/src/gui_w32.c Mon Sep 16 22:00:32 2002 --- src/gui_w32.c Tue Oct 8 21:11:49 2002 *************** *** 1372,1384 **** State &= ~LANGMAP; if (State & INSERT) { - long old_imi = curbuf->b_p_iminsert; - - curbuf->b_p_iminsert = B_IMODE_IM; - #if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP) /* Unshown 'keymap' in status lines */ ! if (old_imi == B_IMODE_LMAP) { /* Save cursor position */ int old_row = gui.row; --- 1367,1375 ---- State &= ~LANGMAP; if (State & INSERT) { #if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP) /* Unshown 'keymap' in status lines */ ! if (curbuf->b_p_iminsert == B_IMODE_LMAP) { /* Save cursor position */ int old_row = gui.row; *** ../vim61.222/src/normal.c Sun Oct 13 16:05:33 2002 --- src/normal.c Sun Oct 13 15:14:34 2002 *************** *** 915,921 **** #ifdef USE_IM_CONTROL if (lang) { ! im_save_status(&curbuf->b_p_iminsert); im_set_active(FALSE); } p_smd = save_smd; --- 915,922 ---- #ifdef USE_IM_CONTROL if (lang) { ! if (curbuf->b_p_iminsert != B_IMODE_LMAP) ! im_save_status(&curbuf->b_p_iminsert); im_set_active(FALSE); } p_smd = save_smd; *** ../vim61.222/src/version.c Sun Oct 13 20:12:29 2002 --- src/version.c Mon Oct 14 20:08:46 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 223, /**/ -- From the classified section of a city newspaper: Dog for sale: eats anything and is fond of children. /// 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 /// \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///