Skip to content

Commit e87303a

Browse files
committed
patch 8.0.1597: autocommand events are not sorted
Problem: Autocommand events are not sorted. Solution: Sort the autocommand events.
1 parent b852c3e commit e87303a

File tree

2 files changed

+38
-37
lines changed

2 files changed

+38
-37
lines changed

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,8 @@ static char *(features[]) =
766766

767767
static int included_patches[] =
768768
{ /* Add new patch number below this line */
769+
/**/
770+
1597,
769771
/**/
770772
1596,
771773
/**/

src/vim.h

Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,67 +1251,92 @@ typedef struct {
12511251
enum auto_event
12521252
{
12531253
EVENT_BUFADD = 0, /* after adding a buffer to the buffer list */
1254-
EVENT_BUFNEW, /* after creating any buffer */
12551254
EVENT_BUFDELETE, /* deleting a buffer from the buffer list */
1256-
EVENT_BUFWIPEOUT, /* just before really deleting a buffer */
12571255
EVENT_BUFENTER, /* after entering a buffer */
12581256
EVENT_BUFFILEPOST, /* after renaming a buffer */
12591257
EVENT_BUFFILEPRE, /* before renaming a buffer */
1258+
EVENT_BUFHIDDEN, /* just after buffer becomes hidden */
12601259
EVENT_BUFLEAVE, /* before leaving a buffer */
1260+
EVENT_BUFNEW, /* after creating any buffer */
12611261
EVENT_BUFNEWFILE, /* when creating a buffer for a new file */
1262+
EVENT_BUFREADCMD, /* read buffer using command */
12621263
EVENT_BUFREADPOST, /* after reading a buffer */
12631264
EVENT_BUFREADPRE, /* before reading a buffer */
1264-
EVENT_BUFREADCMD, /* read buffer using command */
12651265
EVENT_BUFUNLOAD, /* just before unloading a buffer */
1266-
EVENT_BUFHIDDEN, /* just after buffer becomes hidden */
12671266
EVENT_BUFWINENTER, /* after showing a buffer in a window */
12681267
EVENT_BUFWINLEAVE, /* just after buffer removed from window */
1268+
EVENT_BUFWIPEOUT, /* just before really deleting a buffer */
1269+
EVENT_BUFWRITECMD, /* write buffer using command */
12691270
EVENT_BUFWRITEPOST, /* after writing a buffer */
12701271
EVENT_BUFWRITEPRE, /* before writing a buffer */
1271-
EVENT_BUFWRITECMD, /* write buffer using command */
12721272
EVENT_CMDLINECHANGED, /* command line was modified*/
12731273
EVENT_CMDLINEENTER, /* after entering the command line */
12741274
EVENT_CMDLINELEAVE, /* before leaving the command line */
1275+
EVENT_CMDUNDEFINED, /* command undefined */
12751276
EVENT_CMDWINENTER, /* after entering the cmdline window */
12761277
EVENT_CMDWINLEAVE, /* before leaving the cmdline window */
12771278
EVENT_COLORSCHEME, /* after loading a colorscheme */
12781279
EVENT_COMPLETEDONE, /* after finishing insert complete */
1279-
EVENT_DIRCHANGED, /* after changing directory as a result of user cmd */
1280+
EVENT_CURSORHOLD, /* cursor in same position for a while */
1281+
EVENT_CURSORHOLDI, /* idem, in Insert mode */
1282+
EVENT_CURSORMOVED, /* cursor was moved */
1283+
EVENT_CURSORMOVEDI, /* cursor was moved in Insert mode */
1284+
EVENT_DIRCHANGED, /* after user changed directory */
1285+
EVENT_ENCODINGCHANGED, /* after changing the 'encoding' option */
12801286
EVENT_EXITPRE, /* before exiting */
1287+
EVENT_FILEAPPENDCMD, /* append to a file using command */
12811288
EVENT_FILEAPPENDPOST, /* after appending to a file */
12821289
EVENT_FILEAPPENDPRE, /* before appending to a file */
1283-
EVENT_FILEAPPENDCMD, /* append to a file using command */
1290+
EVENT_FILECHANGEDRO, /* before first change to read-only file */
12841291
EVENT_FILECHANGEDSHELL, /* after shell command that changed file */
12851292
EVENT_FILECHANGEDSHELLPOST, /* after (not) reloading changed file */
1286-
EVENT_FILECHANGEDRO, /* before first change to read-only file */
1293+
EVENT_FILEREADCMD, /* read from a file using command */
12871294
EVENT_FILEREADPOST, /* after reading a file */
12881295
EVENT_FILEREADPRE, /* before reading a file */
1289-
EVENT_FILEREADCMD, /* read from a file using command */
12901296
EVENT_FILETYPE, /* new file type detected (user defined) */
1297+
EVENT_FILEWRITECMD, /* write to a file using command */
12911298
EVENT_FILEWRITEPOST, /* after writing a file */
12921299
EVENT_FILEWRITEPRE, /* before writing a file */
1293-
EVENT_FILEWRITECMD, /* write to a file using command */
12941300
EVENT_FILTERREADPOST, /* after reading from a filter */
12951301
EVENT_FILTERREADPRE, /* before reading from a filter */
12961302
EVENT_FILTERWRITEPOST, /* after writing to a filter */
12971303
EVENT_FILTERWRITEPRE, /* before writing to a filter */
12981304
EVENT_FOCUSGAINED, /* got the focus */
12991305
EVENT_FOCUSLOST, /* lost the focus to another app */
1306+
EVENT_FUNCUNDEFINED, /* if calling a function which doesn't exist */
13001307
EVENT_GUIENTER, /* after starting the GUI */
13011308
EVENT_GUIFAILED, /* after starting the GUI failed */
13021309
EVENT_INSERTCHANGE, /* when changing Insert/Replace mode */
1310+
EVENT_INSERTCHARPRE, /* before inserting a char */
13031311
EVENT_INSERTENTER, /* when entering Insert mode */
13041312
EVENT_INSERTLEAVE, /* when leaving Insert mode */
13051313
EVENT_MENUPOPUP, /* just before popup menu is displayed */
1314+
EVENT_OPTIONSET, /* option was set */
13061315
EVENT_QUICKFIXCMDPOST, /* after :make, :grep etc. */
13071316
EVENT_QUICKFIXCMDPRE, /* before :make, :grep etc. */
13081317
EVENT_QUITPRE, /* before :quit */
1318+
EVENT_REMOTEREPLY, /* upon string reception from a remote vim */
13091319
EVENT_SESSIONLOADPOST, /* after loading a session file */
1320+
EVENT_SHELLCMDPOST, /* after ":!cmd" */
1321+
EVENT_SHELLFILTERPOST, /* after ":1,2!cmd", ":w !cmd", ":r !cmd". */
1322+
EVENT_SOURCECMD, /* sourcing a Vim script using command */
1323+
EVENT_SOURCEPRE, /* before sourcing a Vim script */
1324+
EVENT_SPELLFILEMISSING, /* spell file missing */
13101325
EVENT_STDINREADPOST, /* after reading from stdin */
13111326
EVENT_STDINREADPRE, /* before reading from stdin */
1327+
EVENT_SWAPEXISTS, /* found existing swap file */
13121328
EVENT_SYNTAX, /* syntax selected */
1329+
EVENT_TABCLOSED, /* after closing a tab page */
1330+
EVENT_TABENTER, /* after entering a tab page */
1331+
EVENT_TABLEAVE, /* before leaving a tab page */
1332+
EVENT_TABNEW, /* when entering a new tab page */
13131333
EVENT_TERMCHANGED, /* after changing 'term' */
1334+
EVENT_TERMINALOPEN, /* after a terminal buffer was created */
13141335
EVENT_TERMRESPONSE, /* after setting "v:termresponse" */
1336+
EVENT_TEXTCHANGED, /* text was modified not in Insert mode */
1337+
EVENT_TEXTCHANGEDI, /* text was modified in Insert mode */
1338+
EVENT_TEXTCHANGEDP, /* TextChangedI with popup menu visible */
1339+
EVENT_TEXTYANKPOST, /* after some text was yanked */
13151340
EVENT_USER, /* user defined autocommand */
13161341
EVENT_VIMENTER, /* after starting Vim */
13171342
EVENT_VIMLEAVE, /* before exiting Vim */
@@ -1320,33 +1345,7 @@ enum auto_event
13201345
EVENT_WINENTER, /* after entering a window */
13211346
EVENT_WINLEAVE, /* before leaving a window */
13221347
EVENT_WINNEW, /* when entering a new window */
1323-
EVENT_ENCODINGCHANGED, /* after changing the 'encoding' option */
1324-
EVENT_INSERTCHARPRE, /* before inserting a char */
1325-
EVENT_CURSORHOLD, /* cursor in same position for a while */
1326-
EVENT_CURSORHOLDI, /* idem, in Insert mode */
1327-
EVENT_FUNCUNDEFINED, /* if calling a function which doesn't exist */
1328-
EVENT_REMOTEREPLY, /* upon string reception from a remote vim */
1329-
EVENT_SWAPEXISTS, /* found existing swap file */
1330-
EVENT_SOURCEPRE, /* before sourcing a Vim script */
1331-
EVENT_SOURCECMD, /* sourcing a Vim script using command */
1332-
EVENT_SPELLFILEMISSING, /* spell file missing */
1333-
EVENT_CURSORMOVED, /* cursor was moved */
1334-
EVENT_CURSORMOVEDI, /* cursor was moved in Insert mode */
1335-
EVENT_TABENTER, /* after entering a tab page */
1336-
EVENT_TABLEAVE, /* before leaving a tab page */
1337-
EVENT_TABNEW, /* when entering a new tab page */
1338-
EVENT_TABCLOSED, /* after closing a tab page */
1339-
EVENT_SHELLCMDPOST, /* after ":!cmd" */
1340-
EVENT_SHELLFILTERPOST, /* after ":1,2!cmd", ":w !cmd", ":r !cmd". */
1341-
EVENT_TEXTCHANGED, /* text was modified not in Insert mode */
1342-
EVENT_TEXTCHANGEDI, /* text was modified in Insert mode without
1343-
popup menu visible */
1344-
EVENT_TEXTCHANGEDP, /* text was modified in Insert mode with popup
1345-
menu visible */
1346-
EVENT_CMDUNDEFINED, /* command undefined */
1347-
EVENT_OPTIONSET, /* option was set */
1348-
EVENT_TEXTYANKPOST, /* after some text was yanked */
1349-
EVENT_TERMINALOPEN, /* after a terminal buffer was created */
1348+
13501349
NUM_EVENTS /* MUST be the last one */
13511350
};
13521351

0 commit comments

Comments
 (0)