Mercurial > vim
diff src/userfunc.c @ 24436:ccdd5e9a3763 v8.2.2758
patch 8.2.2758: Vim9: wrong line number for autoload function with wrong name
Commit: https://github.com/vim/vim/commit/f48b2fa33cda94e963f6fa8b78f344385c9ebea6
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Apr 12 22:02:36 2021 +0200
patch 8.2.2758: Vim9: wrong line number for autoload function with wrong name
Problem: Vim9: wrong line number for autoload function with wrong name.
Solution: Set and restore SOURCING_LNUM. (closes https://github.com/vim/vim/issues/8100)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 12 Apr 2021 22:15:03 +0200 |
parents | 41cf1155ab90 |
children | faac16c365b6 |
line wrap: on
line diff
--- a/src/userfunc.c +++ b/src/userfunc.c @@ -4058,7 +4058,11 @@ define_function(exarg_T *eap, char_u *na } if (j == FAIL) { + linenr_T save_lnum = SOURCING_LNUM; + + SOURCING_LNUM = sourcing_lnum_top; semsg(_("E746: Function name does not match script file name: %s"), name); + SOURCING_LNUM = save_lnum; goto erret; } }