Mercurial > vim
comparison src/vim9compile.c @ 25149:18b31f0a4bb5 v8.2.3111
patch 8.2.3111: Vim9: confusing error with extra whitespace before colon
Commit: https://github.com/vim/vim/commit/404557e6a60389d09bbf91dd0cf3bae11bd623b9
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jul 5 21:41:48 2021 +0200
patch 8.2.3111: Vim9: confusing error with extra whitespace before colon
Problem: Vim9: confusing error with extra whitespace before colon.
Solution: Check for colon after white space. (closes https://github.com/vim/vim/issues/8513)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 05 Jul 2021 21:45:04 +0200 |
parents | 7fa520b85244 |
children | c44d6ac81c42 |
comparison
equal
deleted
inserted
replaced
25148:004577226b10 | 25149:18b31f0a4bb5 |
---|---|
7773 wp = p; | 7773 wp = p; |
7774 if (may_get_next_line_error(wp, &p, cctx) == FAIL) | 7774 if (may_get_next_line_error(wp, &p, cctx) == FAIL) |
7775 return NULL; | 7775 return NULL; |
7776 if (STRNCMP(p, "in", 2) != 0 || !IS_WHITE_OR_NUL(p[2])) | 7776 if (STRNCMP(p, "in", 2) != 0 || !IS_WHITE_OR_NUL(p[2])) |
7777 { | 7777 { |
7778 emsg(_(e_missing_in)); | 7778 if (*p == ':' && wp != p) |
7779 semsg(_(e_no_white_space_allowed_before_colon_str), p); | |
7780 else | |
7781 emsg(_(e_missing_in)); | |
7779 return NULL; | 7782 return NULL; |
7780 } | 7783 } |
7781 wp = p + 2; | 7784 wp = p + 2; |
7782 if (may_get_next_line_error(wp, &p, cctx) == FAIL) | 7785 if (may_get_next_line_error(wp, &p, cctx) == FAIL) |
7783 return NULL; | 7786 return NULL; |