do you mean:
:silent call s:foo()
> catch
> " nop.
> endtry
> endfunc
> ----- code -----
>
> ":call Foo()" makes Vim stay 'silent mode'
>
> After this, :some_command can work fine, but nothing shown in command-line
> as typing.
> This bug occurs in this version:
> http://sourceforge.net/projects/cream/files/Vim/7.2.259/gvim-7-2-259.exe/download
nothing unusual here (gVim 7.2.218) ...
--
Andy
> http://sourceforge.net/projects/cream/files/Vim/7.2.259/gvim-7-2-259.exe/do=
> wnload
I see the problem. This actually happens because the "call" is missing
and "s:foo()" is a substitute command, just like "s/foo()//".
When changing it to this:
func! s:foo()
throw 'exception'
endfunc
func! Foo()
try
silent s:foo()
catch
unsilent echo "EX: " . v:exception
endtry
endfunc
You can see the error message:
EX: Vim(substitute):E486: Pattern not found: foo()
But when the cursor is on the line with "silent" there is no error and
the bug isn't trigerred.
I'll fix it.
--
He was not in the least bit scared to be mashed into a pulp
Or to have his eyes gouged out and his elbows broken;
To have his kneecaps split and his body burned away
And his limbs all hacked and mangled, brave Sir Robin.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
> I see the problem. This actually happens because the "call" is
> missing and "s:foo()" is a substitute command, just like "s/foo()//".
>
> When changing it to this:
>
> func! s:foo()
> throw 'exception'
> endfunc
>
> func! Foo()
> try
> silent s:foo()
> catch
> unsilent echo "EX: " . v:exception
> endtry
> endfunc
>
> You can see the error message:
> EX: Vim(substitute):E486: Pattern not found: foo()
>
> But when the cursor is on the line with "silent" there is no error and
... because the :substitute succeeds (to explain it to myself and a few
others).
> the bug isn't trigerred.
Which bug? Do you want to disallow this valid :subst-syntax?
> I'll fix it.
You want to disallow the ":"-char for separating :subst arguments? Ok.
Worse: Require at least two :subst-separator chars.
--
Andy
Instead of giving arguments against the fix you might want to try to
reproduce the problem. Like dr-dr xp explained, the problem is that
after the exception is thrown, whatever you type in the command line
is not displayed.
--
Kind regards,
Lech Lorens
I was just curious and took the risk of giving a dumb argument, hoping
somebody like you will point me to the right direction ...
Think I got it: The "bug" was introduced with a later patch (maybe the
patch adding the :unsilent command) and I forgot that I can't reproduce
it with my older version.
--
Andy