comparison src/insexpand.c @ 26042:6b39ab99e367 v8.2.3555

patch 8.2.3555: ModeChanged is not triggered on every mode change Commit: https://github.com/vim/vim/commit/25def2c8b8bd7b0c3d5f020207c717a880b05d50 Author: =?UTF-8?q?Magnus=20Gro=C3=9F?= <magnus.gross@rwth-aachen.de> Date: Fri Oct 22 18:56:39 2021 +0100 patch 8.2.3555: ModeChanged is not triggered on every mode change Problem: ModeChanged is not triggered on every mode change. Solution: Also trigger on minor mode changes. (Maguns Gross, closes https://github.com/vim/vim/issues/8999)
author Bram Moolenaar <Bram@vim.org>
date Fri, 22 Oct 2021 20:00:05 +0200
parents ac330e2fecc4
children f2392648af3e
comparison
equal deleted inserted replaced
26041:1f1f9e2a021b 26042:6b39ab99e367
241 } 241 }
242 else 242 else
243 // CTRL-X in CTRL-X CTRL-V mode behaves differently to make CTRL-X 243 // CTRL-X in CTRL-X CTRL-V mode behaves differently to make CTRL-X
244 // CTRL-V look like CTRL-N 244 // CTRL-V look like CTRL-N
245 ctrl_x_mode = CTRL_X_CMDLINE_CTRL_X; 245 ctrl_x_mode = CTRL_X_CMDLINE_CTRL_X;
246
247 trigger_modechanged();
246 } 248 }
247 249
248 /* 250 /*
249 * Functions to check the current CTRL-X mode. 251 * Functions to check the current CTRL-X mode.
250 */ 252 */
2148 else if (ctrl_x_mode == CTRL_X_LOCAL_MSG) 2150 else if (ctrl_x_mode == CTRL_X_LOCAL_MSG)
2149 // Trigger the CompleteDone event to give scripts a chance to act 2151 // Trigger the CompleteDone event to give scripts a chance to act
2150 // upon the (possibly failed) completion. 2152 // upon the (possibly failed) completion.
2151 ins_apply_autocmds(EVENT_COMPLETEDONE); 2153 ins_apply_autocmds(EVENT_COMPLETEDONE);
2152 2154
2155 trigger_modechanged();
2156
2153 // reset continue_* if we left expansion-mode, if we stay they'll be 2157 // reset continue_* if we left expansion-mode, if we stay they'll be
2154 // (re)set properly in ins_complete() 2158 // (re)set properly in ins_complete()
2155 if (!vim_is_ctrl_x_key(c)) 2159 if (!vim_is_ctrl_x_key(c))
2156 { 2160 {
2157 compl_cont_status = 0; 2161 compl_cont_status = 0;
2485 compl_enter_selects = compl_no_insert; 2489 compl_enter_selects = compl_no_insert;
2486 2490
2487 // Lazily show the popup menu, unless we got interrupted. 2491 // Lazily show the popup menu, unless we got interrupted.
2488 if (!compl_interrupted) 2492 if (!compl_interrupted)
2489 show_pum(save_w_wrow, save_w_leftcol); 2493 show_pum(save_w_wrow, save_w_leftcol);
2494 trigger_modechanged();
2490 out_flush(); 2495 out_flush();
2491 } 2496 }
2492 2497
2493 /* 2498 /*
2494 * "complete()" function 2499 * "complete()" function
3253 compl_curr_match = compl_direction == FORWARD ? compl_old_match->cp_next 3258 compl_curr_match = compl_direction == FORWARD ? compl_old_match->cp_next
3254 : compl_old_match->cp_prev; 3259 : compl_old_match->cp_prev;
3255 if (compl_curr_match == NULL) 3260 if (compl_curr_match == NULL)
3256 compl_curr_match = compl_old_match; 3261 compl_curr_match = compl_old_match;
3257 } 3262 }
3263 trigger_modechanged();
3264
3258 return i; 3265 return i;
3259 } 3266 }
3260 3267
3261 /* 3268 /*
3262 * Delete the old text being completed. 3269 * Delete the old text being completed.