comparison src/evalvars.c @ 26952:b34ddbca305c v8.2.4005

patch 8.2.4005: error messages are spread out Commit: https://github.com/vim/vim/commit/a6f7929e62c19a6a2418a016b4c59b83eb1887ac Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 4 21:30:47 2022 +0000 patch 8.2.4005: error messages are spread out Problem: Error messages are spread out. Solution: Move more error messages to errors.h.
author Bram Moolenaar <Bram@vim.org>
date Tue, 04 Jan 2022 22:45:04 +0100
parents 3631d2deb36c
children d92e0d85923f
comparison
equal deleted inserted replaced
26951:c3fbe78b6109 26952:b34ddbca305c
962 } 962 }
963 963
964 i = list_len(l); 964 i = list_len(l);
965 if (semicolon == 0 && var_count < i) 965 if (semicolon == 0 && var_count < i)
966 { 966 {
967 emsg(_("E687: Less targets than List items")); 967 emsg(_(e_less_targets_than_list_items));
968 return FAIL; 968 return FAIL;
969 } 969 }
970 if (var_count - semicolon > i) 970 if (var_count - semicolon > i)
971 { 971 {
972 emsg(_("E688: More targets than List items")); 972 emsg(_(e_more_targets_than_list_items));
973 return FAIL; 973 return FAIL;
974 } 974 }
975 975
976 CHECK_LIST_MATERIALIZE(l); 976 CHECK_LIST_MATERIALIZE(l);
977 item = l->lv_first; 977 item = l->lv_first;
1254 case 't': list_tab_vars(first); break; 1254 case 't': list_tab_vars(first); break;
1255 case 'v': list_vim_vars(first); break; 1255 case 'v': list_vim_vars(first); break;
1256 case 's': list_script_vars(first); break; 1256 case 's': list_script_vars(first); break;
1257 case 'l': list_func_vars(first); break; 1257 case 'l': list_func_vars(first); break;
1258 default: 1258 default:
1259 semsg(_("E738: Can't list variables for %s"), name); 1259 semsg(_(e_cant_list_variables_for_str), name);
1260 } 1260 }
1261 } 1261 }
1262 else 1262 else
1263 { 1263 {
1264 char_u numbuf[NUMBUFLEN]; 1264 char_u numbuf[NUMBUFLEN];
3689 if (!((vim_strchr((char_u *)"wbt", name[0]) != NULL 3689 if (!((vim_strchr((char_u *)"wbt", name[0]) != NULL
3690 || (!in_vim9script() && name[0] == 's')) && name[1] == ':') 3690 || (!in_vim9script() && name[0] == 's')) && name[1] == ':')
3691 && !ASCII_ISUPPER((name[0] != NUL && name[1] == ':') 3691 && !ASCII_ISUPPER((name[0] != NUL && name[1] == ':')
3692 ? name[2] : name[0])) 3692 ? name[2] : name[0]))
3693 { 3693 {
3694 semsg(_("E704: Funcref variable name must start with a capital: %s"), 3694 semsg(_(e_funcref_variable_name_must_start_with_capital_str), name);
3695 name);
3696 return TRUE; 3695 return TRUE;
3697 } 3696 }
3698 // Don't allow hiding a function. When "v" is not NULL we might be 3697 // Don't allow hiding a function. When "v" is not NULL we might be
3699 // assigning another function to the same var, the type is checked 3698 // assigning another function to the same var, the type is checked
3700 // below. 3699 // below.
3701 if (new_var && function_exists(name, FALSE)) 3700 if (new_var && function_exists(name, FALSE))
3702 { 3701 {
3703 semsg(_("E705: Variable name conflicts with existing function: %s"), 3702 semsg(_(e_variable_name_conflicts_with_existing_function_str),
3704 name); 3703 name);
3705 return TRUE; 3704 return TRUE;
3706 } 3705 }
3707 return FALSE; 3706 return FALSE;
3708 } 3707 }