To: vim_dev@googlegroups.com Subject: Patch 8.1.1746 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.1746 Problem: ":dl" is seen as ":dlist" instead of ":delete". Solution: Do not use cmdidxs2[] if the length is 1. (closes #4721) Files: src/ex_docmd.c, src/testdir/test_excmd.vim, src/testdir/Make_all.mak *** ../vim-8.1.1745/src/ex_docmd.c 2019-07-24 16:00:34.926180368 +0200 --- src/ex_docmd.c 2019-07-24 22:26:09.045689793 +0200 *************** *** 3191,3197 **** if (ASCII_ISLOWER(eap->cmd[0])) { int c1 = eap->cmd[0]; ! int c2 = eap->cmd[1]; if (command_count != (int)CMD_SIZE) { --- 3191,3197 ---- if (ASCII_ISLOWER(eap->cmd[0])) { int c1 = eap->cmd[0]; ! int c2 = len == 1 ? NUL : eap->cmd[1]; if (command_count != (int)CMD_SIZE) { *** ../vim-8.1.1745/src/testdir/test_excmd.vim 2019-07-24 22:29:50.164712552 +0200 --- src/testdir/test_excmd.vim 2019-07-24 22:25:28.865859564 +0200 *************** *** 0 **** --- 1,10 ---- + " Tests for various Ex commands. + + func Test_ex_delete() + new + call setline(1, ['a', 'b', 'c']) + 2 + " :dl is :delete with the "l" flag, not :dlist + .dl + call assert_equal(['a', 'c'], getline(1, 2)) + endfunc *** ../vim-8.1.1745/src/testdir/Make_all.mak 2019-06-15 17:57:43.968724059 +0200 --- src/testdir/Make_all.mak 2019-07-24 22:25:04.617960681 +0200 *************** *** 106,111 **** --- 106,112 ---- test_ex_equal \ test_ex_undo \ test_ex_z \ + test_excmd \ test_exec_while_if \ test_execute_func \ test_exists \ *************** *** 328,333 **** --- 329,335 ---- test_erasebackword.res \ test_escaped_glob.res \ test_eval_stuff.res \ + test_excmd.res \ test_exec_while_if.res \ test_exists.res \ test_exists_autocmd.res \ *** ../vim-8.1.1745/src/version.c 2019-07-24 19:00:32.941236032 +0200 --- src/version.c 2019-07-24 22:18:31.331400856 +0200 *************** *** 779,780 **** --- 779,782 ---- { /* Add new patch number below this line */ + /**/ + 1746, /**/ -- "Lisp has all the visual appeal of oatmeal with nail clippings thrown in." -- Larry Wall /// 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 ///