comparison src/vim9execute.c @ 20419:d54dfb5f12db v8.2.0764

patch 8.2.0764: Vim9: assigning to option not fully tested Commit: https://github.com/vim/vim/commit/a6e67e4f41386c3e6eab7e047671c6d32f6cb0dc Author: Bram Moolenaar <Bram@vim.org> Date: Fri May 15 23:36:40 2020 +0200 patch 8.2.0764: Vim9: assigning to option not fully tested Problem: Vim9: assigning to option not fully tested. Solution: Add more test cases. Allow using any type for assignment.
author Bram Moolenaar <Bram@vim.org>
date Fri, 15 May 2020 23:45:04 +0200
parents 23af9e1a5283
children 0ab8f8880a33
comparison
equal deleted inserted replaced
20418:2005771741d3 20419:d54dfb5f12db
1162 { 1162 {
1163 s = tv->vval.v_string; 1163 s = tv->vval.v_string;
1164 if (s == NULL) 1164 if (s == NULL)
1165 s = (char_u *)""; 1165 s = (char_u *)"";
1166 } 1166 }
1167 else if (tv->v_type == VAR_NUMBER) 1167 else
1168 // must be VAR_NUMBER, CHECKTYPE makes sure
1168 n = tv->vval.v_number; 1169 n = tv->vval.v_number;
1169 else
1170 {
1171 emsg(_("E1051: Expected string or number"));
1172 goto failed;
1173 }
1174 msg = set_option_value(iptr->isn_arg.storeopt.so_name, 1170 msg = set_option_value(iptr->isn_arg.storeopt.so_name,
1175 n, s, iptr->isn_arg.storeopt.so_flags); 1171 n, s, iptr->isn_arg.storeopt.so_flags);
1176 if (msg != NULL) 1172 if (msg != NULL)
1177 { 1173 {
1178 emsg(_(msg)); 1174 emsg(_(msg));