From 342764d70ee8c9f05f4389a523dfd09f0795fcd1 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Wed, 23 Apr 2014 21:55:12 +0200 Subject: vim-patch:7.4.260 Problem: It is possible to define a function with a colon in the name. It is possible to define a function with a lower case character if a "#" appears after the name. Solution: Disallow using a colon other than with "s:". Ignore "#" after the name. https://code.google.com/p/vim/source/detail?r=6bc874e4789a0f912b4fd6b23afecf19d80b1605 --- src/testdir/test_eval.in | 24 ++++++++++++++++++++++++ src/testdir/test_eval.ok | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 src/testdir/test_eval.in create mode 100644 src/testdir/test_eval.ok (limited to 'src/testdir') diff --git a/src/testdir/test_eval.in b/src/testdir/test_eval.in new file mode 100644 index 0000000000..44eeabfe73 --- /dev/null +++ b/src/testdir/test_eval.in @@ -0,0 +1,24 @@ +STARTTEST +:" function name includes a colon +:try +: func! g:test() +: echo "test" +: endfunc +:catch +: let @a = v:exception +:endtry +:" function name folowed by # +:try +: func! test2() "# +: echo "test2" +: endfunc +:catch +: let @b = v:exception +:endtry +:%d +:pu a +:pu b +:1d +:wq! test.out +ENDTEST +start: diff --git a/src/testdir/test_eval.ok b/src/testdir/test_eval.ok new file mode 100644 index 0000000000..8aaac316c5 --- /dev/null +++ b/src/testdir/test_eval.ok @@ -0,0 +1,2 @@ +Vim(function):E128: Function name must start with a capital or "s:": g:test() +Vim(function):E128: Function name must start with a capital or "s:": test2() "# -- cgit