Mercurial > vim
comparison src/userfunc.c @ 23888:d95403445b6b v8.2.2486
patch 8.2.2486: Vim9: some errors for white space do not show context
Commit: https://github.com/vim/vim/commit/ba98fb54aefada4c36390add4c7dd90b93e7e5bb
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 7 18:06:29 2021 +0100
patch 8.2.2486: Vim9: some errors for white space do not show context
Problem: Vim9: some errors for white space do not show context.
Solution: Include the text at the error.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 07 Feb 2021 18:15:05 +0100 |
parents | 9ddf1a537fc2 |
children | e979bf909fd8 |
comparison
equal
deleted
inserted
replaced
23887:ee748fa7dcf5 | 23888:d95403445b6b |
---|---|
876 // checked previously, thus only enforce it in Vim9 script. | 876 // checked previously, thus only enforce it in Vim9 script. |
877 if (vim9script) | 877 if (vim9script) |
878 { | 878 { |
879 if (*argp != ',' && *skipwhite(argp) == ',') | 879 if (*argp != ',' && *skipwhite(argp) == ',') |
880 { | 880 { |
881 semsg(_(e_no_white_space_allowed_before_str), ","); | 881 semsg(_(e_no_white_space_allowed_before_str_str), ",", argp); |
882 ret = FAIL; | 882 ret = FAIL; |
883 break; | 883 break; |
884 } | 884 } |
885 } | 885 } |
886 else | 886 else |
3212 p = vim_strchr(p, '('); | 3212 p = vim_strchr(p, '('); |
3213 } | 3213 } |
3214 | 3214 |
3215 if ((vim9script || eap->cmdidx == CMD_def) && VIM_ISWHITE(p[-1])) | 3215 if ((vim9script || eap->cmdidx == CMD_def) && VIM_ISWHITE(p[-1])) |
3216 { | 3216 { |
3217 semsg(_(e_no_white_space_allowed_before_str), "("); | 3217 semsg(_(e_no_white_space_allowed_before_str_str), "(", p - 1); |
3218 goto ret_free; | 3218 goto ret_free; |
3219 } | 3219 } |
3220 | 3220 |
3221 // In Vim9 script only global functions can be redefined. | 3221 // In Vim9 script only global functions can be redefined. |
3222 if (vim9script && eap->forceit && !is_global) | 3222 if (vim9script && eap->forceit && !is_global) |