[vim/vim] Examples in the document can be improved. (Issue #18984)

1 view
Skip to first unread message

Mao-Yining

unread,
Dec 20, 2025, 9:23:56 PM (5 hours ago) Dec 20
to vim/vim, Subscribed
mao-yining created an issue (vim/vim#18984)

In :h :catch

					*:cat* *:catch*
					*E603* *E604* *E605* *E654* *E1033*
:cat[ch] [/{pattern}/]	The following commands until the next `:catch`,
			`:finally`, or `:endtry` that belongs to the same
			`:try` as the `:catch` are executed when an exception
			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: >
		: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 /.*/

Those examples which contain \%((\a\+)\)\= can't match Vim(!):E371: .


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18984@github.com>

Reply all
Reply to author
Forward
0 new messages