Dasn wrote:
> :h catch-interrupt
> shows an example of catching interrupts, but it works not as it was
> described. The document says:
>
> > If you press CTRL-C at the prompt, the script is terminated.
>
> But the problem is: when I press CTRL-C at the prompt, the script is not
> terminated, instead, it will give you another prompt.
>
> How to catch the interrupts at 'input()' prompt?
>
> I'm not currently on the list, please Cc me, Thanks.
This works just fine for me:
try
let reply = input("what ")
catch /Vim:Interrupt/
let reply = "caught " . v:exception
endtry
echo reply
--
hundred-and-one symptoms of being an internet addict:
213. Your kids start referring to you as "that guy in front of the monitor."
/// Bram Moolenaar -- [email protected] -- 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 ///
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---