Consider the following script:

    function! ERB()
        execute "try"
           \."\n   echo tr()"
           \."\n catch"
           \."\n   echomsg v:exception"
           \."\n   return 1"
           \."\n endtry"
           \."\n return 0"
        return r
    endfunction
    echomsg ERB()
    execute "try"
       \."\n   call tr()"
       \."\n catch"
       \."\n   echomsg v:exception"
       \."\n endtry"

(also attached). If you source it with `vim -u NONE -N -S 
execute-return-bug.vim` you will see

    Vim(echo):E119: Not enough arguments for function: tr
    0
    Error detected while processing /home/zyx/tmp/vim/execute-return-bug.vim:
    line   16:
    E119: Not enough arguments for function: tr

while expected to see

    Vim(echo):E119: Not enough arguments for function: tr
    1
    Vim(call):E119: Not enough arguments for function: tr

(note the second line: it contains 1; and the third: it shows caught 
exception). If I unwrap the script (replace `:execute` calls with the string it 
executes) then everything works as expected.

-- 
-- 
You received this message from the "vim_dev" 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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Attachment: execute-return-bug.vim
Description: Binary data

Attachment: execute-return-bug.vim
Description: Binary data

Raspunde prin e-mail lui