To: vim_dev@googlegroups.com Subject: Patch 8.2.0593 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0593 Problem: Finding a user command is not optimal. Solution: Start further down in the list of commands. Files: src/ex_cmds.h, src/ex_docmd.c *** ../vim-8.2.0592/src/ex_cmds.h 2020-03-19 14:37:26.447743562 +0100 --- src/ex_cmds.h 2020-04-18 16:42:34.087515919 +0200 *************** *** 1775,1781 **** EX_RANGE|EX_WHOLEFOLD|EX_EXTRA|EX_FLAGS|EX_TRLBAR|EX_CMDWIN, ADDR_LINES), ! // commands that don't start with a lowercase letter EXCMD(CMD_bang, "!", ex_bang, EX_RANGE|EX_WHOLEFOLD|EX_BANG|EX_FILES|EX_CMDWIN, ADDR_LINES), --- 1775,1781 ---- EX_RANGE|EX_WHOLEFOLD|EX_EXTRA|EX_FLAGS|EX_TRLBAR|EX_CMDWIN, ADDR_LINES), ! // commands that don't start with a letter EXCMD(CMD_bang, "!", ex_bang, EX_RANGE|EX_WHOLEFOLD|EX_BANG|EX_FILES|EX_CMDWIN, ADDR_LINES), *************** *** 1800,1805 **** --- 1800,1810 ---- EXCMD(CMD_at, "@", ex_at, EX_RANGE|EX_WHOLEFOLD|EX_EXTRA|EX_TRLBAR|EX_CMDWIN, ADDR_LINES), + EXCMD(CMD_tilde, "~", do_sub, + EX_RANGE|EX_WHOLEFOLD|EX_EXTRA|EX_CMDWIN|EX_MODIFY, + ADDR_LINES), + + // commands that start with an uppercase letter EXCMD(CMD_Next, "Next", ex_previous, EX_EXTRA|EX_RANGE|EX_COUNT|EX_BANG|EX_CMDARG|EX_ARGOPT|EX_TRLBAR, ADDR_OTHER), *************** *** 1809,1817 **** EXCMD(CMD_X, "X", ex_X, EX_TRLBAR, ADDR_NONE), - EXCMD(CMD_tilde, "~", do_sub, - EX_RANGE|EX_WHOLEFOLD|EX_EXTRA|EX_CMDWIN|EX_MODIFY, - ADDR_LINES), #undef EXCMD --- 1814,1819 ---- *** ../vim-8.2.0592/src/ex_docmd.c 2020-04-16 23:01:46.958088087 +0200 --- src/ex_docmd.c 2020-04-18 17:39:39.806919359 +0200 *************** *** 3153,3161 **** char_u * find_ex_command( exarg_T *eap, ! int *full UNUSED, ! int (*lookup)(char_u *, size_t, cctx_T *) UNUSED, ! cctx_T *cctx UNUSED) { int len; char_u *p; --- 3153,3161 ---- char_u * find_ex_command( exarg_T *eap, ! int *full UNUSED, ! int (*lookup)(char_u *, size_t, cctx_T *) UNUSED, ! cctx_T *cctx UNUSED) { int len; char_u *p; *************** *** 3285,3290 **** --- 3285,3292 ---- if (ASCII_ISLOWER(c2)) eap->cmdidx += cmdidxs2[CharOrdLow(c1)][CharOrdLow(c2)]; } + else if (ASCII_ISUPPER(eap->cmd[0])) + eap->cmdidx = CMD_Next; else eap->cmdidx = CMD_bang; *************** *** 4766,4772 **** /* * Check if "c" ends an Ex command. ! * In Vim9 script does not check for white space before #. */ int ends_excmd(int c) --- 4768,4774 ---- /* * Check if "c" ends an Ex command. ! * In Vim9 script does not check for white space before # or #{. */ int ends_excmd(int c) *** ../vim-8.2.0592/src/version.c 2020-04-17 21:12:57.982980152 +0200 --- src/version.c 2020-04-18 17:38:52.295014707 +0200 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 593, /**/ -- Lower life forms have more fun! /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///