It looks like calls to dictionary functions of autoload variables do
not trigger the autoload.
This happens when the `call` command is used, and does not happen when
`echo` or `let` is the command.
It also does not happen when the call() function is called instead of
making a direct call to the dictionary function.
EG:
$ for f in .vim/autoload/foo.vim .vim/plugin/foo.vim tests.sh
tests.out; do
> echo "$f:"; cat "$f" | sed 's/^/ /'; echo --; done
.vim/autoload/foo.vim:
let foo#d = {}
funct! foo#d.f()
return "food!"
endfunct
--
.vim/plugin/foo.vim:
comma! Food echo foo#d.f()
comma! LetFood let f = foo#d.f()
comma! CallFood call foo#d.f()
comma! CallCallFood call call(foo#d.f, [], {})
--
tests.sh:
stripescape() {
sed 's/\x1b\[45;1H//g';
}
testfood() {
echo "test: $1";
HOME=. vim -T dumb -e -c "$1" -c q | stripescape | sed 's/
^/ /';
echo;
}
for command in Food LetFood CallFood CallCallFood; do
testfood "$command";
done;
--
tests.out:
test: Food
food!
test: LetFood
test: CallFood
Error detected while processing command line:
E121: Undefined variable: foo#d
test: CallCallFood
--
BTW is there a way to get vim to cease entirely to emit terminal
codes? I managed to stifle them in this case by passing `-T dumb` and
sedding out the remaining codes, but hopefully there is a better way.
Salutations,
-Ted
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php