Mercurial > vim
diff src/vim.h @ 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 | 154663508d9b |
children | e8873138ffbb |
line wrap: on
line diff
--- a/src/vim.h +++ b/src/vim.h @@ -688,6 +688,8 @@ extern int (*dyn_libintl_wputenv)(const #define TERMINAL 0x2000 // Terminal mode #define MODE_ALL 0xffff +#define MODE_MAX_LENGTH 4 // max mode length returned in mode() + // all mode bits used for mapping #define MAP_ALL_MODES (0x3f | SELECTMODE | TERMINAL) @@ -1317,6 +1319,7 @@ enum auto_event EVENT_INSERTLEAVEPRE, // just before leaving Insert mode EVENT_INSERTLEAVE, // just after leaving Insert mode EVENT_MENUPOPUP, // just before popup menu is displayed + EVENT_MODECHANGED, // after changing the mode EVENT_OPTIONSET, // option was set EVENT_QUICKFIXCMDPOST, // after :make, :grep etc. EVENT_QUICKFIXCMDPRE, // before :make, :grep etc.