comparison src/textprop.c @ 15146:7903dce131d4 v8.1.0583

patch 8.1.0583: using illogical name for get_dict_number()/get_dict_string() commit https://github.com/vim/vim/commit/8f66717a1f835b8194139d158c1e2df8b30c3ef3 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 14 15:38:31 2018 +0100 patch 8.1.0583: using illogical name for get_dict_number()/get_dict_string() Problem: Using illogical name for get_dict_number()/get_dict_string(). Solution: Rename to start with dict_.
author Bram Moolenaar <Bram@vim.org>
date Fri, 14 Dec 2018 15:45:06 +0100
parents 7960bf50d345
children 4b2de998ebd6
comparison
equal deleted inserted replaced
15145:14de49f92ace 15146:7903dce131d4
171 if (dict == NULL || dict_find(dict, (char_u *)"type", -1) == NULL) 171 if (dict == NULL || dict_find(dict, (char_u *)"type", -1) == NULL)
172 { 172 {
173 EMSG(_("E965: missing property type name")); 173 EMSG(_("E965: missing property type name"));
174 return; 174 return;
175 } 175 }
176 type_name = get_dict_string(dict, (char_u *)"type", FALSE); 176 type_name = dict_get_string(dict, (char_u *)"type", FALSE);
177 177
178 if (dict_find(dict, (char_u *)"end_lnum", -1) != NULL) 178 if (dict_find(dict, (char_u *)"end_lnum", -1) != NULL)
179 { 179 {
180 // TODO: handle end_lnum 180 // TODO: handle end_lnum
181 EMSG("Sorry, end_lnum not supported yet"); 181 EMSG("Sorry, end_lnum not supported yet");
182 return; 182 return;
183 } 183 }
184 184
185 if (dict_find(dict, (char_u *)"length", -1) != NULL) 185 if (dict_find(dict, (char_u *)"length", -1) != NULL)
186 length = get_dict_number(dict, (char_u *)"length"); 186 length = dict_get_number(dict, (char_u *)"length");
187 else if (dict_find(dict, (char_u *)"end_col", -1) != NULL) 187 else if (dict_find(dict, (char_u *)"end_col", -1) != NULL)
188 { 188 {
189 length = get_dict_number(dict, (char_u *)"end_col") - col; 189 length = dict_get_number(dict, (char_u *)"end_col") - col;
190 if (length <= 0) 190 if (length <= 0)
191 { 191 {
192 EMSG2(_(e_invargval), "end_col"); 192 EMSG2(_(e_invargval), "end_col");
193 return; 193 return;
194 } 194 }
195 } 195 }
196 196
197 if (dict_find(dict, (char_u *)"id", -1) != NULL) 197 if (dict_find(dict, (char_u *)"id", -1) != NULL)
198 id = get_dict_number(dict, (char_u *)"id"); 198 id = dict_get_number(dict, (char_u *)"id");
199 199
200 if (get_bufnr_from_arg(&argvars[2], &buf) == FAIL) 200 if (get_bufnr_from_arg(&argvars[2], &buf) == FAIL)
201 return; 201 return;
202 202
203 type = lookup_prop_type(type_name, buf); 203 type = lookup_prop_type(type_name, buf);
263 redraw_buf_later(buf, NOT_VALID); 263 redraw_buf_later(buf, NOT_VALID);
264 } 264 }
265 265
266 /* 266 /*
267 * Return TRUE if any text properties are defined globally or for buffer 267 * Return TRUE if any text properties are defined globally or for buffer
268 * 'buf". 268 * "buf".
269 */ 269 */
270 int 270 int
271 has_any_text_properties(buf_T *buf) 271 has_any_text_properties(buf_T *buf)
272 { 272 {
273 return buf->b_proptypes != NULL || global_proptypes != NULL; 273 return buf->b_proptypes != NULL || global_proptypes != NULL;
496 return; 496 return;
497 } 497 }
498 498
499 di = dict_find(dict, (char_u*)"all", -1); 499 di = dict_find(dict, (char_u*)"all", -1);
500 if (di != NULL) 500 if (di != NULL)
501 do_all = get_dict_number(dict, (char_u *)"all"); 501 do_all = dict_get_number(dict, (char_u *)"all");
502 502
503 if (dict_find(dict, (char_u *)"id", -1) != NULL) 503 if (dict_find(dict, (char_u *)"id", -1) != NULL)
504 id = get_dict_number(dict, (char_u *)"id"); 504 id = dict_get_number(dict, (char_u *)"id");
505 if (dict_find(dict, (char_u *)"type", -1)) 505 if (dict_find(dict, (char_u *)"type", -1))
506 { 506 {
507 char_u *name = get_dict_string(dict, (char_u *)"type", FALSE); 507 char_u *name = dict_get_string(dict, (char_u *)"type", FALSE);
508 proptype_T *type = lookup_prop_type(name, buf); 508 proptype_T *type = lookup_prop_type(name, buf);
509 509
510 if (type == NULL) 510 if (type == NULL)
511 return; 511 return;
512 type_id = type->pt_id; 512 type_id = type->pt_id;
640 if (di != NULL) 640 if (di != NULL)
641 { 641 {
642 char_u *highlight; 642 char_u *highlight;
643 int hl_id = 0; 643 int hl_id = 0;
644 644
645 highlight = get_dict_string(dict, (char_u *)"highlight", FALSE); 645 highlight = dict_get_string(dict, (char_u *)"highlight", FALSE);
646 if (highlight != NULL && *highlight != NUL) 646 if (highlight != NULL && *highlight != NUL)
647 hl_id = syn_name2id(highlight); 647 hl_id = syn_name2id(highlight);
648 if (hl_id <= 0) 648 if (hl_id <= 0)
649 { 649 {
650 EMSG2(_("E970: Unknown highlight group name: '%s'"), 650 EMSG2(_("E970: Unknown highlight group name: '%s'"),