Mercurial > vim
diff src/userfunc.c @ 17732:1726c2db81bf v8.1.1863
patch 8.1.1863: confusing error when using a builtin function as method
commit https://github.com/vim/vim/commit/9174639a82799011cfa0013cbc4c4709b3833bf0
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Aug 16 22:22:31 2019 +0200
patch 8.1.1863: confusing error when using a builtin function as method
Problem: Confusing error when using a builtin function as method while it
does not support that.
Solution: Add a specific error message.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 16 Aug 2019 22:30:04 +0200 |
parents | 121bdff812b4 |
children | 117c7795a979 |
line wrap: on
line diff
--- a/src/userfunc.c +++ b/src/userfunc.c @@ -1678,6 +1678,11 @@ call_func( case ERROR_UNKNOWN: emsg_funcname(N_("E117: Unknown function: %s"), name); break; + case ERROR_NOTMETHOD: + emsg_funcname( + N_("E276: Cannot use function as a method: %s"), + name); + break; case ERROR_DELETED: emsg_funcname(N_("E933: Function was deleted: %s"), name); break; @@ -1685,15 +1690,18 @@ call_func( emsg_funcname((char *)e_toomanyarg, name); break; case ERROR_TOOFEW: - emsg_funcname(N_("E119: Not enough arguments for function: %s"), + emsg_funcname( + N_("E119: Not enough arguments for function: %s"), name); break; case ERROR_SCRIPT: - emsg_funcname(N_("E120: Using <SID> not in a script context: %s"), + emsg_funcname( + N_("E120: Using <SID> not in a script context: %s"), name); break; case ERROR_DICT: - emsg_funcname(N_("E725: Calling dict function without Dictionary: %s"), + emsg_funcname( + N_("E725: Calling dict function without Dictionary: %s"), name); break; }