Skip to content

Instantly share code, notes, and snippets.

@thinca
Created June 17, 2013 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thinca/5797391 to your computer and use it in GitHub Desktop.
Save thinca/5797391 to your computer and use it in GitHub Desktop.
diff -r 6e9667d3f166 src/eval.c
--- a/src/eval.c Sun Jun 16 22:49:14 2013 +0200
+++ b/src/eval.c Mon Jun 17 23:40:59 2013 +0900
@@ -21281,12 +21281,7 @@
if (!eap->skip)
{
- /* Check the name of the function. Unless it's a dictionary function
- * (that we are overwriting). */
- if (name != NULL)
- arg = name;
- else
- arg = fudi.fd_newkey;
+ arg = name;
if (arg != NULL && (fudi.fd_di == NULL
|| fudi.fd_di->di_tv.v_type != VAR_FUNC))
{
diff -r 6e9667d3f166 src/testdir/test55.in
--- a/src/testdir/test55.in Sun Jun 16 22:49:14 2013 +0200
+++ b/src/testdir/test55.in Mon Jun 17 23:40:59 2013 +0900
@@ -190,6 +190,13 @@
:catch
: $put =v:exception[:15]
:endtry
+:"
+:" Dictionary function that is not a variable name
+:let g:dict = {}
+:function g:dict['/func']() dict
+: $put ='/func'
+:endfunc
+:call g:dict['/func']()
:"
:" Function in script-local List or Dict
:let g:dict = {}
diff -r 6e9667d3f166 src/testdir/test55.ok
--- a/src/testdir/test55.ok Sun Jun 16 22:49:14 2013 +0200
+++ b/src/testdir/test55.ok Mon Jun 17 23:40:59 2013 +0900
@@ -47,8 +47,9 @@
len: 3
again: 3
Vim(call):E725:
+/func
g:dict.func-4
-a:function('3')
+a:function('4')
Vim(let):E698:
same list: 1
depth is 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment