]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(doc): Improve :catch documentation
authorChristian Brabandt <cb@256bit.org>
Tue, 23 Dec 2025 21:58:57 +0000 (21:58 +0000)
committerChristian Brabandt <cb@256bit.org>
Tue, 23 Dec 2025 21:58:57 +0000 (21:58 +0000)
fixes: #18984

Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/eval.txt

index 7c853795eec81af91a14b1be07ba8612bdae5aa0..8a252b63dbaf6c0d5a9ae454d39fc2fd467bc2d3 100644 (file)
@@ -1,4 +1,4 @@
-*eval.txt*     For Vim version 9.1.  Last change: 2025 Dec 21
+*eval.txt*     For Vim version 9.1.  Last change: 2025 Dec 23
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -3718,12 +3718,15 @@ text...
                        matching {pattern} is being thrown and has not yet
                        been caught by a previous `:catch`.  Otherwise, these
                        commands are skipped.
-                       When {pattern} is omitted all errors are caught.
-                       Examples: >
+                       Pattern can start with "Vim({cmd})" to indicate an
+                       exception that occurred when executing the Ex command
+                       {cmd}.  When {pattern} is omitted all errors are
+                       caught. Examples: >
                :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(!):/                " catch all errors in :!
                :catch /^Vim\%((\a\+)\)\=:E123:/ " catch error E123
                :catch /my-exception/            " catch user exception
                :catch /.*/                      " catch everything