nvim_runtime_lua

vim._core.ui2.messages

Methods9

function messages.expand_msg(src, tgt, focus: nil | boolean) -> any

Move messages to expanded cmdline, dialog or pager to show in full. Return updated target+buffer in case it differs from 'src'.

Parameters
src
tgt
focusnil | boolean

Enter the pager: it was explicitly requested.

Returns
any
function messages.show_msg(tgt: "cmd" | "dialog" | "msg" | "pager", kind: string, content: MsgContent, replace_last: boolean, append: boolean, id: string | integer) -> nil
function messages.msg_show(kind: string, content: MsgContent, replace_last: boolean, _, append: boolean, id: string | integer, trigger: string) -> nil
function messages.msg_clear() -> nil

Clear currently visible messages.

function messages.msg_showmode(content: MsgContent) -> nil

Place the mode text in the cmdline.

function messages.msg_showcmd(content: MsgContent) -> nil

Place text from the 'showcmd' buffer in the cmdline.

function messages.msg_ruler(content: MsgContent) -> nil

Place the 'ruler' text in the cmdline window.

function messages.msg_history_show(entries: MsgHistory[], prev_cmd: boolean) -> nil
function messages.set_pos(tgt: "cmd" | "dialog" | "msg" | "pager" | nil, focus: nil | boolean) -> nil

Adjust visibility and dimensions of the message windows after certain events.

Parameters
tgt"cmd" | "dialog" | "msg" | "pager" | nil

Target window to be positioned (nil for all).

focusnil | boolean

Enter the pager: it was explicitly requested.

Returns
nil

Fields5

messages.msg: table

Message window. Used for regular messages with cfg.msg.target == 'msg'. Automatically resizes to the text dimensions up to a point, at which point only the most recent messages will fit and be shown. A timer is started for each message whose callback will remove the message from the window again.

messages.cmd: table

Cmdline message window. Used for regular messages with cfg.msg.target == 'cmd'. Also contains 'ruler', 'showcmd' and searchcmd/count messages as virttext. Messages that don't fit the 'cmdheight' are first shown in an expanded cmdline. Otherwise, or after an expanded cmdline is closed upon the first keypress, the cmdline contains the messages with spilled and duplicate lines indicators.

messages.virt: table
messages.dialog_on_key : nil | integer

vim.on_key namespace for paging in the dialog window.

messages.cmd_on_key : nil | integer

vim.on_key namespace while cmdline is expanded.