summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/testdir/input/vim_ex_catch.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/syntax/testdir/input/vim_ex_catch.vim')
-rw-r--r--runtime/syntax/testdir/input/vim_ex_catch.vim17
1 files changed, 17 insertions, 0 deletions
diff --git a/runtime/syntax/testdir/input/vim_ex_catch.vim b/runtime/syntax/testdir/input/vim_ex_catch.vim
new file mode 100644
index 0000000..f0e2a8f
--- /dev/null
+++ b/runtime/syntax/testdir/input/vim_ex_catch.vim
@@ -0,0 +1,17 @@
+" Vim :catch command
+
+" :help :catch
+
+catch /^Vim:Interrupt$/ " catch interrupts (CTRL-C)
+catch /^Vim\%((\a\+)\)\=:E/ " catch all Vim errors
+catch /^Vim\%((\a\+)\)\=:/ " catch errors and interrupts
+catch /^Vim(write):/ " catch all errors in :write
+catch /^Vim\%((\a\+)\)\=:E123:/ " catch error E123
+catch /my-exception/ " catch user exception
+catch /.*/ " catch everything
+catch " same as /.*/
+
+" :help :try
+
+try | sleep 100 | catch /^Vim:Interrupt$/ | endtry
+try | edit | catch /^Vim(edit):E\d\+/ | echo "error" | endtry