Skip to content

Commit 6d211bc

Browse files
committed
runtime(doc): Improve :catch documentation
fixes: #18984 Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 519dc39 commit 6d211bc

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

runtime/doc/eval.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 9.1. Last change: 2025 Dec 21
1+
*eval.txt* For Vim version 9.1. Last change: 2025 Dec 23
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -3718,12 +3718,15 @@ text...
37183718
matching {pattern} is being thrown and has not yet
37193719
been caught by a previous `:catch`. Otherwise, these
37203720
commands are skipped.
3721-
When {pattern} is omitted all errors are caught.
3722-
Examples: >
3721+
Pattern can start with "Vim({cmd})" to indicate an
3722+
exception that occurred when executing the Ex command
3723+
{cmd}. When {pattern} is omitted all errors are
3724+
caught. Examples: >
37233725
:catch /^Vim:Interrupt$/ " catch interrupts (CTRL-C)
37243726
:catch /^Vim\%((\a\+)\)\=:E/ " catch all Vim errors
37253727
:catch /^Vim\%((\a\+)\)\=:/ " catch errors and interrupts
37263728
:catch /^Vim(write):/ " catch all errors in :write
3729+
:catch /^Vim(!):/ " catch all errors in :!
37273730
:catch /^Vim\%((\a\+)\)\=:E123:/ " catch error E123
37283731
:catch /my-exception/ " catch user exception
37293732
:catch /.*/ " catch everything

0 commit comments

Comments
 (0)