comparison src/ex_getln.c @ 25790:16a7d1154be8 v8.2.3430

patch 8.2.3430: no generic way to trigger an autocommand on mode change Commit: https://github.com/vim/vim/commit/f1e8876fa2359b572d262772747405d3616db670 Author: =?UTF-8?q?Magnus=20Gro=C3=9F?= <magnus.gross@rwth-aachen.de> Date: Sun Sep 12 13:39:55 2021 +0200 patch 8.2.3430: no generic way to trigger an autocommand on mode change Problem: No generic way to trigger an autocommand on mode change. Solution: Add the ModeChanged autocommand event. (Magnus Gross, closes https://github.com/vim/vim/issues/8856)
author Bram Moolenaar <Bram@vim.org>
date Sun, 12 Sep 2021 13:45:05 +0200
parents e8e2c4d33b9b
children 054623fc54c5
comparison
equal deleted inserted replaced
25789:3afd5ab3d69a 25790:16a7d1154be8
1694 settmode(TMODE_RAW); 1694 settmode(TMODE_RAW);
1695 1695
1696 // Trigger CmdlineEnter autocommands. 1696 // Trigger CmdlineEnter autocommands.
1697 cmdline_type = firstc == NUL ? '-' : firstc; 1697 cmdline_type = firstc == NUL ? '-' : firstc;
1698 trigger_cmd_autocmd(cmdline_type, EVENT_CMDLINEENTER); 1698 trigger_cmd_autocmd(cmdline_type, EVENT_CMDLINEENTER);
1699 #ifdef FEAT_EVAL
1700 if (!debug_mode)
1701 trigger_modechanged();
1702 #endif
1699 1703
1700 init_history(); 1704 init_history();
1701 hiscnt = get_hislen(); // set hiscnt to impossible history value 1705 hiscnt = get_hislen(); // set hiscnt to impossible history value
1702 histype = hist_char2type(firstc); 1706 histype = hist_char2type(firstc);
1703 1707
2459 2463
2460 // Trigger CmdlineLeave autocommands. 2464 // Trigger CmdlineLeave autocommands.
2461 trigger_cmd_autocmd(cmdline_type, EVENT_CMDLINELEAVE); 2465 trigger_cmd_autocmd(cmdline_type, EVENT_CMDLINELEAVE);
2462 2466
2463 State = save_State; 2467 State = save_State;
2468
2469 #ifdef FEAT_EVAL
2470 if (!debug_mode)
2471 trigger_modechanged();
2472 #endif
2473
2464 #ifdef HAVE_INPUT_METHOD 2474 #ifdef HAVE_INPUT_METHOD
2465 if (b_im_ptr != NULL && *b_im_ptr != B_IMODE_LMAP) 2475 if (b_im_ptr != NULL && *b_im_ptr != B_IMODE_LMAP)
2466 im_save_status(b_im_ptr); 2476 im_save_status(b_im_ptr);
2467 im_set_active(FALSE); 2477 im_set_active(FALSE);
2468 #endif 2478 #endif