diff options
author | Bram Moolenaar <Bram@vim.org> | 2008-09-07 11:55:43 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2008-09-07 11:55:43 +0000 |
commit | a85fb757a19ddc9fa3a3dbc786b388294d9b7eee (patch) | |
tree | c36672c22296369ca7706c6f7da41988e5a1afed | |
parent | 3094a9e1a7f6b6923aec469046cfdf84c7686374 (diff) |
updated for version 7.2-011v7.2.011
-rw-r--r-- | src/eval.c | 16 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/eval.c b/src/eval.c index 351f24c37d..9c8515e039 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1256,23 +1256,26 @@ skip_expr(pp) /* * Top level evaluation function, returning a string. + * When "convert" is TRUE convert a List into a sequence of lines and convert + * a Float to a String. * Return pointer to allocated memory, or NULL for failure. */ char_u * -eval_to_string(arg, nextcmd, dolist) +eval_to_string(arg, nextcmd, convert) char_u *arg; char_u **nextcmd; - int dolist; /* turn List into sequence of lines */ + int convert; { typval_T tv; char_u *retval; garray_T ga; + char_u numbuf[NUMBUFLEN]; if (eval0(arg, &tv, nextcmd, TRUE) == FAIL) retval = NULL; else { - if (dolist && tv.v_type == VAR_LIST) + if (convert && tv.v_type == VAR_LIST) { ga_init2(&ga, (int)sizeof(char), 80); if (tv.vval.v_list != NULL) @@ -1280,6 +1283,13 @@ eval_to_string(arg, nextcmd, dolist) ga_append(&ga, NUL); retval = (char_u *)ga.ga_data; } +#ifdef FEAT_FLOAT + else if (convert && tv.v_type == VAR_FLOAT) + { + vim_snprintf((char *)numbuf, NUMBUFLEN, "%g", tv.vval.v_float); + retval = vim_strsave(numbuf); + } +#endif else retval = vim_strsave(get_tv_string(&tv)); clear_tv(&tv); diff --git a/src/version.c b/src/version.c index 2ed3271920..cd13eb2c0d 100644 --- a/src/version.c +++ b/src/version.c @@ -677,6 +677,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 11, +/**/ 10, /**/ 9, |