Mercurial > vim
comparison src/eval.c @ 31867:7d505d77f6da v9.0.1266
patch 9.0.1266: error for space before ": type" is inconsistent
Commit: https://github.com/vim/vim/commit/ce93d162da8de2419c15b63286e2f72a8fe3bf2d
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jan 30 21:12:34 2023 +0000
patch 9.0.1266: error for space before ": type" is inconsistent
Problem: Error for space before ": type" is inconsistent.
Solution: Give E1059 in more places. (closes https://github.com/vim/vim/issues/11868)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 30 Jan 2023 22:15:03 +0100 |
parents | cd4065ab4503 |
children | ec05de98b0f7 |
comparison
equal
deleted
inserted
replaced
31866:b398a8a9ad05 | 31867:7d505d77f6da |
---|---|
1091 if (p == name + 2 && p[-1] == ':' && *p != '[') | 1091 if (p == name + 2 && p[-1] == ':' && *p != '[') |
1092 { | 1092 { |
1093 --p; | 1093 --p; |
1094 lp->ll_name_end = p; | 1094 lp->ll_name_end = p; |
1095 } | 1095 } |
1096 if (*p == ':') | 1096 if (*skipwhite(p) == ':') |
1097 { | 1097 { |
1098 char_u *tp = skipwhite(p + 1); | 1098 char_u *tp = skipwhite(p + 1); |
1099 | 1099 |
1100 if (is_scoped_variable(name)) | 1100 if (is_scoped_variable(name)) |
1101 { | 1101 { |
1102 semsg(_(e_cannot_use_type_with_this_variable_str), name); | 1102 semsg(_(e_cannot_use_type_with_this_variable_str), name); |
1103 return NULL; | |
1104 } | |
1105 if (VIM_ISWHITE(*p)) | |
1106 { | |
1107 semsg(_(e_no_white_space_allowed_before_colon_str), p); | |
1103 return NULL; | 1108 return NULL; |
1104 } | 1109 } |
1105 if (tp == p + 1 && !quiet) | 1110 if (tp == p + 1 && !quiet) |
1106 { | 1111 { |
1107 semsg(_(e_white_space_required_after_str_str), ":", p); | 1112 semsg(_(e_white_space_required_after_str_str), ":", p); |