Mercurial > vim
diff src/vim9compile.c @ 23446:b1dbbc81a011 v8.2.2266
patch 8.2.2266: Vim9: it can be hard to see where white space is missing
Commit: https://github.com/vim/vim/commit/e7a73e07625b64a40671a0007ad38a34cbe9d1ee
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jan 1 19:17:55 2021 +0100
patch 8.2.2266: Vim9: it can be hard to see where white space is missing
Problem: Vim9: it can be hard to see where white space is missing.
Solution: Mention the text where the error was seen. (closes https://github.com/vim/vim/issues/7580)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 01 Jan 2021 19:30:04 +0100 |
parents | b0587f7ec422 |
children | a8e7acf71fa4 |
line wrap: on
line diff
--- a/src/vim9compile.c +++ b/src/vim9compile.c @@ -3656,7 +3656,8 @@ compile_subscript( return FAIL; if (**arg == ':') { - semsg(_(e_white_space_required_before_and_after_str), ":"); + semsg(_(e_white_space_required_before_and_after_str_at_str), + ":", *arg); return FAIL; } if (may_get_next_line_error(p, arg, cctx) == FAIL) @@ -3669,7 +3670,8 @@ compile_subscript( ++*arg; if (!IS_WHITE_OR_NUL(**arg) && **arg != ']') { - semsg(_(e_white_space_required_before_and_after_str), ":"); + semsg(_(e_white_space_required_before_and_after_str_at_str), + ":", *arg); return FAIL; } *arg = skipwhite(*arg); @@ -4067,7 +4069,7 @@ error_white_both(char_u *op, int len) char_u buf[10]; vim_strncpy(buf, op, len); - semsg(_(e_white_space_required_before_and_after_str), buf); + semsg(_(e_white_space_required_before_and_after_str_at_str), buf, op); } /* @@ -4434,7 +4436,8 @@ compile_and_or( if (!IS_WHITE_OR_NUL(**arg) || !IS_WHITE_OR_NUL(p[2])) { - semsg(_(e_white_space_required_before_and_after_str), op); + semsg(_(e_white_space_required_before_and_after_str_at_str), + op, *arg); return FAIL; } @@ -4608,8 +4611,8 @@ compile_expr1(char_u **arg, cctx_T *cctx if (!IS_WHITE_OR_NUL(**arg) || !IS_WHITE_OR_NUL(p[1 + op_falsy])) { - semsg(_(e_white_space_required_before_and_after_str), - op_falsy ? "??" : "?"); + semsg(_(e_white_space_required_before_and_after_str_at_str), + op_falsy ? "??" : "?", *arg); return FAIL; } @@ -4695,7 +4698,8 @@ compile_expr1(char_u **arg, cctx_T *cctx if (!IS_WHITE_OR_NUL(**arg) || !IS_WHITE_OR_NUL(p[1])) { - semsg(_(e_white_space_required_before_and_after_str), ":"); + semsg(_(e_white_space_required_before_and_after_str_at_str), + ":", p); return FAIL; }