comparison src/popupwin.c @ 26865:bce848ec8b1b v8.2.3961

patch 8.2.3961: error messages are spread out Commit: https://github.com/vim/vim/commit/436b5adc9770a2568209dd5ab1f98bd1afc91898 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 31 22:49:24 2021 +0000 patch 8.2.3961: error messages are spread out Problem: Error messages are spread out. Solution: Move more errors to errors.h.
author Bram Moolenaar <Bram@vim.org>
date Sat, 01 Jan 2022 00:00:04 +0100
parents 84d60deb8f82
children 06a137af96f8
comparison
equal deleted inserted replaced
26864:eb95ad159bce 26865:bce848ec8b1b
405 for (nr = 0; nr < (int)ARRAY_LENGTH(poppos_entries); ++nr) 405 for (nr = 0; nr < (int)ARRAY_LENGTH(poppos_entries); ++nr)
406 if (STRCMP(str, poppos_entries[nr].pp_name) == 0) 406 if (STRCMP(str, poppos_entries[nr].pp_name) == 0)
407 return poppos_entries[nr].pp_val; 407 return poppos_entries[nr].pp_val;
408 408
409 if (give_error) 409 if (give_error)
410 semsg(_(e_invarg2), str); 410 semsg(_(e_invalid_argument_str), str);
411 return POPPOS_NONE; 411 return POPPOS_NONE;
412 } 412 }
413 413
414 /* 414 /*
415 * Shared between popup_create() and f_popup_move(). 415 * Shared between popup_create() and f_popup_move().
466 466
467 nr = find_prop_type_id(str, wp->w_popup_prop_win->w_buffer); 467 nr = find_prop_type_id(str, wp->w_popup_prop_win->w_buffer);
468 if (nr <= 0) 468 if (nr <= 0)
469 nr = find_prop_type_id(str, NULL); 469 nr = find_prop_type_id(str, NULL);
470 if (nr <= 0) 470 if (nr <= 0)
471 semsg(_(e_invarg2), str); 471 semsg(_(e_invalid_argument_str), str);
472 else 472 else
473 wp->w_popup_prop_type = nr; 473 wp->w_popup_prop_type = nr;
474 } 474 }
475 } 475 }
476 476
495 else if (STRCMP(s, "WORD") == 0) 495 else if (STRCMP(s, "WORD") == 0)
496 flags = FIND_STRING; 496 flags = FIND_STRING;
497 else if (STRCMP(s, "expr") == 0) 497 else if (STRCMP(s, "expr") == 0)
498 flags = FIND_IDENT | FIND_STRING | FIND_EVAL; 498 flags = FIND_IDENT | FIND_STRING | FIND_EVAL;
499 else if (STRCMP(s, "any") != 0) 499 else if (STRCMP(s, "any") != 0)
500 semsg(_(e_invarg2), s); 500 semsg(_(e_invalid_argument_str), s);
501 if (flags != 0) 501 if (flags != 0)
502 { 502 {
503 if (mousemoved) 503 if (mousemoved)
504 set_mousemoved_columns(wp, flags); 504 set_mousemoved_columns(wp, flags);
505 else 505 else
544 wp->w_popup_mincol = mincol; 544 wp->w_popup_mincol = mincol;
545 wp->w_popup_maxcol = maxcol; 545 wp->w_popup_maxcol = maxcol;
546 } 546 }
547 } 547 }
548 else 548 else
549 semsg(_(e_invarg2), tv_get_string(&di->di_tv)); 549 semsg(_(e_invalid_argument_str), tv_get_string(&di->di_tv));
550 } 550 }
551 551
552 static void 552 static void
553 check_highlight(dict_T *dict, char *name, char_u **pval) 553 check_highlight(dict_T *dict, char *name, char_u **pval)
554 { 554 {
557 557
558 di = dict_find(dict, (char_u *)name, -1); 558 di = dict_find(dict, (char_u *)name, -1);
559 if (di != NULL) 559 if (di != NULL)
560 { 560 {
561 if (di->di_tv.v_type != VAR_STRING) 561 if (di->di_tv.v_type != VAR_STRING)
562 semsg(_(e_invargval), name); 562 semsg(_(e_invalid_value_for_argument_str), name);
563 else 563 else
564 { 564 {
565 str = tv_get_string(&di->di_tv); 565 str = tv_get_string(&di->di_tv);
566 if (*str != NUL) 566 if (*str != NUL)
567 *pval = vim_strsave(str); 567 *pval = vim_strsave(str);
733 ok = FALSE; 733 ok = FALSE;
734 } 734 }
735 else 735 else
736 ok = FALSE; 736 ok = FALSE;
737 if (!ok) 737 if (!ok)
738 semsg(_(e_invargNval), "close", tv_get_string(&di->di_tv)); 738 semsg(_(e_invalid_value_for_argument_str_str), "close", tv_get_string(&di->di_tv));
739 } 739 }
740 740
741 str = dict_get_string(dict, (char_u *)"highlight", FALSE); 741 str = dict_get_string(dict, (char_u *)"highlight", FALSE);
742 if (str != NULL) 742 if (str != NULL)
743 { 743 {
859 wp->w_popup_mask = di->di_tv.vval.v_list; 859 wp->w_popup_mask = di->di_tv.vval.v_list;
860 ++wp->w_popup_mask->lv_refcount; 860 ++wp->w_popup_mask->lv_refcount;
861 VIM_CLEAR(wp->w_popup_mask_cells); 861 VIM_CLEAR(wp->w_popup_mask_cells);
862 } 862 }
863 else 863 else
864 semsg(_(e_invargval), "mask"); 864 semsg(_(e_invalid_value_for_argument_str), "mask");
865 } 865 }
866 866
867 #if defined(FEAT_TIMERS) 867 #if defined(FEAT_TIMERS)
868 // Add timer to close the popup after some time. 868 // Add timer to close the popup after some time.
869 nr = dict_get_number(dict, (char_u *)"time"); 869 nr = dict_get_number(dict, (char_u *)"time");
2643 id = (int)tv_get_number(&argvars[0]); 2643 id = (int)tv_get_number(&argvars[0]);
2644 wp = find_popup_win(id); 2644 wp = find_popup_win(id);
2645 if (wp != NULL) 2645 if (wp != NULL)
2646 { 2646 {
2647 if (argvars[1].v_type != VAR_STRING && argvars[1].v_type != VAR_LIST) 2647 if (argvars[1].v_type != VAR_STRING && argvars[1].v_type != VAR_LIST)
2648 semsg(_(e_invarg2), tv_get_string(&argvars[1])); 2648 semsg(_(e_invalid_argument_str), tv_get_string(&argvars[1]));
2649 else 2649 else
2650 { 2650 {
2651 popup_set_buffer_text(wp->w_buffer, argvars[1]); 2651 popup_set_buffer_text(wp->w_buffer, argvars[1]);
2652 redraw_win_later(wp, NOT_VALID); 2652 redraw_win_later(wp, NOT_VALID);
2653 popup_adjust_position(wp); 2653 popup_adjust_position(wp);