Home Explore Blog CI



neovim

13th chunk of `runtime/doc/ui.txt`
e65c80f822fc4571d75f1bd247fd7c71c253a06d59033f070000000100000ea4

==============================================================================
Message/Dialog Events					   *ui-messages*

Activated by the `ext_messages` |ui-option|.
Activates |ui-linegrid| and |ui-cmdline| implicitly.

This UI extension delegates presentation of messages and dialogs. Messages
that would otherwise render in the message/cmdline screen space, are emitted
as UI events.

Nvim will not allocate screen space for the cmdline or messages. 'cmdheight'
will be set to zero, but can be changed and used for the replacing cmdline or
message window. Cmdline state is emitted as |ui-cmdline| events, which the UI
must handle.

["msg_show", kind, content, replace_last, history, append] ~
	Display a message to the user.

	kind
	    Name indicating the message kind:
		"" (empty)	Unknown (consider a |feature-request|)
		"bufwrite"	|:write| message
		"confirm"	Message preceding a prompt (|:confirm|,
				|confirm()|, |inputlist()|, |z=|, …)
		"emsg"		Error (|errors|, internal error, |:throw|, …)
		"echo"		|:echo| message
		"echomsg"	|:echomsg| message
		"echoerr"	|:echoerr| message
		"completion"    |ins-completion-menu| message
		"list_cmd"	List output for various commands (|:ls|, |:set|, …)
		"lua_error"	Error in |:lua| code
		"lua_print"	|print()| from |:lua| code
		"rpc_error"	Error response from |rpcrequest()|
		"return_prompt"	|press-enter| prompt after a multiple messages
		"quickfix"	Quickfix navigation message
		"search_cmd"	Entered search command
		"search_count"	Search count message ("S" flag of 'shortmess')
		"shell_cmd"	|:!cmd| executed command
		"shell_err"	|:!cmd| shell stderr output
		"shell_out"	|:!cmd| shell stdout output
		"shell_ret"	|:!cmd| shell return code
		"undo"		|:undo| and |:redo| message
		"verbose"	'verbose' message
		"wildlist"	'wildmode' "list" message
		"wmsg"		Warning ("search hit BOTTOM", |W10|, …)
	    New kinds may be added in the future; clients should treat unknown
	    kinds as the empty kind.

	content
	    Array of `[attr_id, text_chunk, hl_id]` tuples, building up the
	    message text of chunks of different highlights. No extra spacing
	    should be added between chunks, the `text_chunk` by itself
	    contains any necessary whitespace. Messages can contain line
	    breaks "\n".

	replace_last
	    Decides how multiple messages should be displayed:
	    false: Display the message together with all previous messages
		   that are still visible.
	    true:  Replace the message in the most-recent `msg_show` call,
		   but any other visible message should still remain.

	history
	    True if the message was added to the |:messages| history.

	append
	    True if the message should be appeneded to the previous message,
	    rather than started on a new line. Is set for |:echon|.

["msg_clear"] ~
	Clear all messages currently displayed by "msg_show". (Messages sent
	by other "msg_" events below will not be affected).

["msg_showmode", content] ~
	Shows 'showmode' and |recording| messages. `content` has the same
	format as in "msg_show". This event is sent with empty `content` to
	hide the last message.

["msg_showcmd", content] ~
	Shows 'showcmd' messages. `content` has the same format as in "msg_show".
	This event is sent with empty `content` to hide the last message.

["msg_ruler", content] ~
	Used to display 'ruler' when there is no space for the ruler in a
	statusline. `content` has the same format as in "msg_show". This event is
	sent with empty `content` to hide the last message.

["msg_history_show", entries] ~
	Sent when |:messages| command is invoked. History is sent as a list of
	entries, where each entry is a `[kind, content]` tuple.

["msg_history_clear"] ~
	Clear the |:messages| history.

 vim:tw=78:ts=8:noet:ft=help:norl:

Title: Message/Dialog Events (Continued)
Summary
Continuing the description of Message/Dialog events, the chunk details the meaning of the `kind` field in the `msg_show` event, including values like `echoerr`, `completion`, `list_cmd`, `lua_error`, `rpc_error`, and several shell-related message types, among others. It also specifies the structure of the `content` array, `replace_last`, `history`, and `append`. Further, this section documents other message-related events such as `msg_clear`, which clears currently displayed messages, `msg_showmode` for 'showmode' and recording messages, `msg_showcmd` for 'showcmd' messages, `msg_ruler` for displaying the ruler when there's no statusline space, `msg_history_show` for displaying message history, and `msg_history_clear` for clearing message history.