Mercurial > vim
comparison src/userfunc.c @ 25632:c204815f3058 v8.2.3352
patch 8.2.3352: Vim9: error for nested :enddef has wrong line number
Commit: https://github.com/vim/vim/commit/4bba16d252da6f072d311f9b3ebb50101d6d2eaf
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 15 19:28:05 2021 +0200
patch 8.2.3352: Vim9: error for nested :enddef has wrong line number
Problem: Vim9: error for nested :enddef has wrong line number.
Solution: Compute the line number.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 15 Aug 2021 19:30:03 +0200 |
parents | 164cef0bc7ab |
children | ce91372ca07b |
comparison
equal
deleted
inserted
replaced
25631:592a92a4d221 | 25632:c204815f3058 |
---|---|
820 else if (line_arg != NULL && *skipwhite(line_arg) != NUL) | 820 else if (line_arg != NULL && *skipwhite(line_arg) != NUL) |
821 nextcmd = line_arg; | 821 nextcmd = line_arg; |
822 else if (*p != NUL && *p != (vim9_function ? '#' : '"') | 822 else if (*p != NUL && *p != (vim9_function ? '#' : '"') |
823 && (vim9_function || p_verbose > 0)) | 823 && (vim9_function || p_verbose > 0)) |
824 { | 824 { |
825 SOURCING_LNUM = sourcing_lnum_top | |
826 + newlines->ga_len + 1; | |
825 if (eap->cmdidx == CMD_def) | 827 if (eap->cmdidx == CMD_def) |
826 semsg(_(e_text_found_after_enddef_str), p); | 828 semsg(_(e_text_found_after_enddef_str), p); |
827 else | 829 else |
828 give_warning2((char_u *) | 830 give_warning2((char_u *) |
829 _("W22: Text found after :endfunction: %s"), | 831 _("W22: Text found after :endfunction: %s"), |