Mercurial > vim
comparison src/vim9execute.c @ 23628:b26bbc03126a v8.2.2356
patch 8.2.2356: Vim9: ":put =expr" does not handle a list properly
Commit: https://github.com/vim/vim/commit/883cf97f109d2ff281cf77f7b2e3bb44aced7cb3
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jan 15 18:04:43 2021 +0100
patch 8.2.2356: Vim9: ":put =expr" does not handle a list properly
Problem: Vim9: ":put =expr" does not handle a list properly.
Solution: Use the same logic as eval_to_string_eap(). (closes https://github.com/vim/vim/issues/7684)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 15 Jan 2021 18:15:05 +0100 |
parents | d228ca435f3a |
children | 83a69ada0274 |
comparison
equal
deleted
inserted
replaced
23627:05eee5de7452 | 23628:b26bbc03126a |
---|---|
3355 tv = STACK_TV_BOT(-1); | 3355 tv = STACK_TV_BOT(-1); |
3356 if (tv->v_type == VAR_STRING) | 3356 if (tv->v_type == VAR_STRING) |
3357 expr = tv->vval.v_string; | 3357 expr = tv->vval.v_string; |
3358 else | 3358 else |
3359 { | 3359 { |
3360 expr = typval_tostring(tv); // allocates value | 3360 expr = typval2string(tv, TRUE); // allocates value |
3361 clear_tv(tv); | 3361 clear_tv(tv); |
3362 } | 3362 } |
3363 --ectx.ec_stack.ga_len; | 3363 --ectx.ec_stack.ga_len; |
3364 } | 3364 } |
3365 if (lnum < -2) | 3365 if (lnum < -2) |