Mercurial > vim
comparison src/list.c @ 30015:adb0de8be4ce v9.0.0345
patch 9.0.0345: error message for list argument could be clearer
Commit: https://github.com/vim/vim/commit/d83392a43a48c566c0f3b76382a3648584dae32b
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 1 12:22:46 2022 +0100
patch 9.0.0345: error message for list argument could be clearer
Problem: Error message for list argument could be clearer.
Solution: Include the argument number. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/11027)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 01 Sep 2022 13:30:05 +0200 |
parents | 6c1a9d7a931f |
children | 029c59bf78f1 |
comparison
equal
deleted
inserted
replaced
30014:3fb163e2ef6c | 30015:adb0de8be4ce |
---|---|
1517 if (in_vim9script() | 1517 if (in_vim9script() |
1518 && (check_for_list_arg(argvars, 0) == FAIL | 1518 && (check_for_list_arg(argvars, 0) == FAIL |
1519 || check_for_opt_string_arg(argvars, 1) == FAIL)) | 1519 || check_for_opt_string_arg(argvars, 1) == FAIL)) |
1520 return; | 1520 return; |
1521 | 1521 |
1522 if (argvars[0].v_type != VAR_LIST) | 1522 if (check_for_list_arg(argvars, 0) == FAIL) |
1523 { | 1523 return; |
1524 emsg(_(e_list_required)); | |
1525 return; | |
1526 } | |
1527 | 1524 |
1528 if (argvars[0].vval.v_list == NULL) | 1525 if (argvars[0].vval.v_list == NULL) |
1529 return; | 1526 return; |
1530 | 1527 |
1531 if (argvars[1].v_type == VAR_UNKNOWN) | 1528 if (argvars[1].v_type == VAR_UNKNOWN) |
1726 if (in_vim9script() | 1723 if (in_vim9script() |
1727 && (check_for_list_arg(argvars, 0) == FAIL | 1724 && (check_for_list_arg(argvars, 0) == FAIL |
1728 || check_for_opt_bool_arg(argvars, 1) == FAIL)) | 1725 || check_for_opt_bool_arg(argvars, 1) == FAIL)) |
1729 return; | 1726 return; |
1730 | 1727 |
1731 if (argvars[0].v_type != VAR_LIST) | 1728 if (check_for_list_arg(argvars, 0) == FAIL) |
1732 { | 1729 return; |
1733 emsg(_(e_invalid_argument)); | |
1734 return; | |
1735 } | |
1736 | 1730 |
1737 l = argvars[0].vval.v_list; | 1731 l = argvars[0].vval.v_list; |
1738 if (l == NULL) | 1732 if (l == NULL) |
1739 return; // empty list results in empty string | 1733 return; // empty list results in empty string |
1740 | 1734 |