Skip to content

Commit

Permalink
patch 8.2.4552: in a :def function "put = expr" does not work
Browse files Browse the repository at this point in the history
Problem:    In a :def function "put = expr" does not work.
Solution:   Skip over white space. (closes #9936)
  • Loading branch information
brammool committed Mar 12, 2022
1 parent bbf84e2 commit d0b7bfa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/testdir/test_vim9_cmd.vim
Expand Up @@ -1217,7 +1217,7 @@ def Test_put_command()
:2put =['a', 'b', 'c']
assert_equal(['ppp', 'a', 'b', 'c', 'above'], getline(2, 6))

:0put ='first'
:0put = 'first'
assert_equal('first', getline(1))
:1put! ='first again'
assert_equal('first again', getline(1))
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -750,6 +750,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4552,
/**/
4551,
/**/
Expand Down
2 changes: 1 addition & 1 deletion src/vim9cmds.c
Expand Up @@ -1767,7 +1767,7 @@ compile_put(char_u *arg, exarg_T *eap, cctx_T *cctx)

if (eap->regname == '=')
{
char_u *p = line + 1;
char_u *p = skipwhite(line + 1);

if (compile_expr0(&p, cctx) == FAIL)
return NULL;
Expand Down

0 comments on commit d0b7bfa

Please sign in to comment.