Mercurial > vim
comparison src/eval.c @ 30217:e0cb5fb44859 v9.0.0444
patch 9.0.0444: trying to declare g:variable gives confusing error
Commit: https://github.com/vim/vim/commit/9510d22463055f56548ff461ccbc54caa1ba1a2f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 11 15:14:05 2022 +0100
patch 9.0.0444: trying to declare g:variable gives confusing error
Problem: Trying to declare g:variable gives confusing error.
Solution: Give a better error message. (closes https://github.com/vim/vim/issues/11108)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 11 Sep 2022 16:15:04 +0200 |
parents | a3016780f346 |
children | c0f0118b6790 |
comparison
equal
deleted
inserted
replaced
30216:cafa3e83fdde | 30217:e0cb5fb44859 |
---|---|
1029 } | 1029 } |
1030 if (*p == ':') | 1030 if (*p == ':') |
1031 { | 1031 { |
1032 char_u *tp = skipwhite(p + 1); | 1032 char_u *tp = skipwhite(p + 1); |
1033 | 1033 |
1034 if (is_scoped_variable(name)) | |
1035 { | |
1036 semsg(_(e_cannot_use_type_with_this_variable_str), name); | |
1037 return NULL; | |
1038 } | |
1034 if (tp == p + 1 && !quiet) | 1039 if (tp == p + 1 && !quiet) |
1035 { | 1040 { |
1036 semsg(_(e_white_space_required_after_str_str), ":", p); | 1041 semsg(_(e_white_space_required_after_str_str), ":", p); |
1037 return NULL; | 1042 return NULL; |
1038 } | 1043 } |
1039 | |
1040 if (!SCRIPT_ID_VALID(current_sctx.sc_sid)) | 1044 if (!SCRIPT_ID_VALID(current_sctx.sc_sid)) |
1041 { | 1045 { |
1042 semsg(_(e_using_type_not_in_script_context_str), p); | 1046 semsg(_(e_using_type_not_in_script_context_str), p); |
1043 return NULL; | 1047 return NULL; |
1044 } | 1048 } |