summaryrefslogtreecommitdiffstats
path: root/runtime/doc/eval.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2005-05-18 22:17:12 +0000
committerBram Moolenaar <Bram@vim.org>2005-05-18 22:17:12 +0000
commita7fc0101b2c5feb7fc70eb79e5b02c61c7de545f (patch)
tree3fb462e659e66b21cfcf4b01c0ab1c7c58f6a436 /runtime/doc/eval.txt
parent142695f3c525035c0ac17e99e8819732585965c3 (diff)
updated for version 7.0072
Diffstat (limited to 'runtime/doc/eval.txt')
-rw-r--r--runtime/doc/eval.txt22
1 files changed, 13 insertions, 9 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index d9020a741a..84571bbc45 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 7.0aa. Last change: 2005 Apr 22
+*eval.txt* For Vim version 7.0aa. Last change: 2005 May 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -194,6 +194,10 @@ is an empty list. If the second index is lower, this results in an error. >
:echo mylist[2:1] " result: []
:echo mylist[2:0] " error!
+NOTE: mylist[s:e] means using the variable "s:e" as index. Watch out for
+using a single letter variable before the ":". Insert a space when needed:
+mylist[s : e].
+
List identity ~
*list-identity*
@@ -4596,14 +4600,14 @@ Using a script in the "autoload" directory is simpler, but requires using
exactly the right file name. A function that can be autoloaded has a name
like this: >
- :call filename:funcname()
+ :call filename#funcname()
When such a function is called, and it is not defined yet, Vim will search the
"autoload" directories in 'runtimepath' for a script file called
"filename.vim". For example "~/.vim/autoload/filename.vim". That file should
then define the function like this: >
- function filename:funcname()
+ function filename#funcname()
echo "Done!"
endfunction
@@ -4611,10 +4615,10 @@ The file name and the name used before the colon in the function must match
exactly, and the defined function must have the name exactly as it will be
called.
-It is possible to use subdirectories. Every colon in the function name works
-like a path separator. Thus when calling a function: >
+It is possible to use subdirectories. Every # in the function name works like
+a path separator. Thus when calling a function: >
- :call foo:bar:func()
+ :call foo#bar#func()
Vim will look for the file "autoload/foo/bar.vim" in 'runtimepath'.
@@ -4623,13 +4627,13 @@ otherwise it looks like a scope, such as "s:".
This also works when reading a variable that has not been set yet: >
- :let l = foo:bar:lvar
+ :let l = foo#bar#lvar
When assigning a value to such a variable nothing special happens. This can
be used to pass settings to the autoload script before it's loaded: >
- :let foo:bar:toggle = 1
- :call foo:bar:func()
+ :let foo#bar#toggle = 1
+ :call foo#bar#func()
Note that when you make a mistake and call a function that is supposed to be
defined in an autoload script, but the script doesn't actually define the