Mercurial > vim
comparison src/vim9execute.c @ 23788:d12ef361d9de v8.2.2435
patch 8.2.2435: setline() gives an error for some types
Commit: https://github.com/vim/vim/commit/3445320839a38b3b0c253513b125da8298ec27d6
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 31 13:08:38 2021 +0100
patch 8.2.2435: setline() gives an error for some types
Problem: setline() gives an error for some types.
Solution: Allow any type, convert each item to a string.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 31 Jan 2021 13:15:04 +0100 |
parents | 7caffd835aa1 |
children | 23d6ead591c1 |
comparison
equal
deleted
inserted
replaced
23787:7b30bc27e54b | 23788:d12ef361d9de |
---|---|
877 case VAR_BLOB: break; | 877 case VAR_BLOB: break; |
878 default: to_string_error(tv->v_type); | 878 default: to_string_error(tv->v_type); |
879 return FAIL; | 879 return FAIL; |
880 } | 880 } |
881 } | 881 } |
882 str = typval_tostring(tv); | 882 str = typval_tostring(tv, TRUE); |
883 clear_tv(tv); | 883 clear_tv(tv); |
884 tv->v_type = VAR_STRING; | 884 tv->v_type = VAR_STRING; |
885 tv->vval.v_string = str; | 885 tv->vval.v_string = str; |
886 } | 886 } |
887 return OK; | 887 return OK; |