Skip to content

Commit

Permalink
patch 8.1.1746: ":dl" is seen as ":dlist" instead of ":delete"
Browse files Browse the repository at this point in the history
Problem:    ":dl" is seen as ":dlist" instead of ":delete".
Solution:   Do not use cmdidxs2[] if the length is 1. (closes #4721)
  • Loading branch information
brammool committed Jul 24, 2019
1 parent 1f164b1 commit 94f82cb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ex_docmd.c
Expand Up @@ -3191,7 +3191,7 @@ find_command(exarg_T *eap, int *full UNUSED)
if (ASCII_ISLOWER(eap->cmd[0]))
{
int c1 = eap->cmd[0];
int c2 = eap->cmd[1];
int c2 = len == 1 ? NUL : eap->cmd[1];

if (command_count != (int)CMD_SIZE)
{
Expand Down
2 changes: 2 additions & 0 deletions src/testdir/Make_all.mak
Expand Up @@ -106,6 +106,7 @@ NEW_TESTS = \
test_ex_equal \
test_ex_undo \
test_ex_z \
test_excmd \
test_exec_while_if \
test_execute_func \
test_exists \
Expand Down Expand Up @@ -328,6 +329,7 @@ NEW_TESTS_RES = \
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 \
Expand Down
10 changes: 10 additions & 0 deletions src/testdir/test_excmd.vim
@@ -0,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
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -777,6 +777,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1746,
/**/
1745,
/**/
Expand Down

0 comments on commit 94f82cb

Please sign in to comment.