Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
message.c File Reference
#include <assert.h>
#include <inttypes.h>
#include <stdarg.h>
#include <stdbool.h>
#include <string.h>
#include "nvim/api/private/helpers.h"
#include "nvim/ascii.h"
#include "nvim/charset.h"
#include "nvim/eval.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
#include "nvim/fileio.h"
#include "nvim/func_attr.h"
#include "nvim/garray.h"
#include "nvim/getchar.h"
#include "nvim/highlight.h"
#include "nvim/input.h"
#include "nvim/keycodes.h"
#include "nvim/main.h"
#include "nvim/mbyte.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/mouse.h"
#include "nvim/normal.h"
#include "nvim/ops.h"
#include "nvim/option.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
#include "nvim/os/time.h"
#include "nvim/regexp.h"
#include "nvim/screen.h"
#include "nvim/strings.h"
#include "nvim/syntax.h"
#include "nvim/ui.h"
#include "nvim/ui_compositor.h"
#include "nvim/vim.h"

Data Structures

struct  msgchunk_S
 

Macros

#define DLG_BUTTON_SEP   '\n'
 
#define DLG_HOTKEY_CHAR   '&'
 
#define MULTILINE_BUFSIZE   8192
 
#define LINE_BUFFER_SIZE   4096
 
#define HAS_HOTKEY_LEN   30
 
#define HOTK_LEN   MB_MAXBYTES
 

Typedefs

typedef struct msgchunk_S msgchunk_T
 

Enumerations

enum  sb_clear_T { SB_CLEAR_NONE = 0, SB_CLEAR_ALL, SB_CLEAR_CMDLINE_BUSY, SB_CLEAR_CMDLINE_DONE }
 

Functions

void msg_grid_set_pos (int row, bool scrolled)
 
bool msg_use_grid (void)
 
void msg_grid_validate (void)
 
int msg (char *s)
 
int verb_msg (char *s)
 Like msg() but keep it silent when 'verbosefile' is set. More...
 
int msg_attr (const char *s, const int attr) FUNC_ATTR_NONNULL_ARG(1)
 
void msg_multiline_attr (const char *s, int attr, bool check_int, bool *need_clear) FUNC_ATTR_NONNULL_ALL
 Similar to msg_outtrans_attr, but support newlines and tabs. More...
 
bool msg_attr_keep (const char *s, int attr, bool keep, bool multiline) FUNC_ATTR_NONNULL_ALL
 
char_umsg_strtrunc (char_u *s, int force)
 
void trunc_string (char_u *s, char_u *buf, int room_in, int buflen)
 
int smsg (const char *s,...) FUNC_ATTR_PRINTF(1
 
int va_start (arglist, s)
 
 vim_vsnprintf ((char *) IObuff, IOSIZE, s, arglist)
 
 va_end (arglist)
 
return msg ((char *) IObuff)
 
int smsg_attr (int attr, const char *s,...) FUNC_ATTR_PRINTF(2
 
return msg_attr ((const char *) IObuff, attr)
 
int smsg_attr_keep (int attr, const char *s,...) FUNC_ATTR_PRINTF(2
 
return msg_attr_keep ((const char *) IObuff, attr, true, false)
 
void reset_last_sourcing (void)
 
void msg_source (int attr)
 
int emsg_not_now (void)
 
bool emsg (const char *s)
 
void emsg_invreg (int name)
 
bool semsg (const char *const fmt,...) FUNC_ATTR_PRINTF(1
 Print an error message with unknown number of arguments. More...
 
 va_start (ap, fmt)
 
 va_end (ap)
 
bool semsg_multiline (const char *const fmt,...)
 
void iemsg (const char *s)
 
void siemsg (const char *s,...)
 
void internal_error (char *where)
 Give an "Internal error" message. More...
 
void msg_schedule_semsg (const char *const fmt,...) FUNC_ATTR_PRINTF(1
 
 vim_vsnprintf ((char *) IObuff, IOSIZE, fmt, ap)
 
 multiqueue_put (main_loop.events, msg_semsg_event, 1, s)
 
char * msg_trunc_attr (char *s, bool force, int attr)
 
char_umsg_may_trunc (bool force, char_u *s)
 
void clear_hl_msg (HlMessage *hl_msg)
 
void add_hl_msg_hist (HlMessage hl_msg)
 
int delete_first_msg (void)
 
void ex_messages (void *const eap_p) FUNC_ATTR_NONNULL_ALL
 :messages command implementation More...
 
void msg_end_prompt (void)
 
void wait_return (int redraw)
 
void set_keep_msg (char *s, int attr)
 Set "keep_msg" to "s". Free the old value and check for NULL pointer. More...
 
void msgmore (long n)
 
void msg_ext_set_kind (const char *msg_kind)
 
void msg_start (void)
 Prepare for outputting characters in the command line. More...
 
void msg_starthere (void)
 Note that the current msg position is where messages start. More...
 
void msg_putchar (int c)
 
void msg_putchar_attr (int c, int attr)
 
void msg_outnum (long n)
 
void msg_home_replace (char_u *fname)
 
void msg_home_replace_hl (char_u *fname)
 
int msg_outtrans (char_u *str)
 
int msg_outtrans_attr (const char_u *str, int attr)
 
int msg_outtrans_len (const char_u *str, int len)
 
char_umsg_outtrans_one (char_u *p, int attr)
 
int msg_outtrans_len_attr (const char_u *msgstr, int len, int attr)
 
void msg_make (char_u *arg)
 
int msg_outtrans_special (const char_u *strstart, bool from, int maxlen)
 
char * str2special_save (const char *const str, const bool replace_spaces, const bool replace_lt) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_MALLOC FUNC_ATTR_NONNULL_RET
 
const char * str2special (const char **const sp, const bool replace_spaces, const bool replace_lt) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_RET
 
void str2specialbuf (const char *sp, char *buf, size_t len) FUNC_ATTR_NONNULL_ALL
 
void msg_prt_line (char_u *s, int list)
 print line for :print or :list command More...
 
void msg_puts (const char *s)
 
void msg_puts_title (const char *s)
 
void msg_outtrans_long_attr (char_u *longstr, int attr)
 
void msg_outtrans_long_len_attr (char_u *longstr, int len, int attr)
 
void msg_puts_attr (const char *const s, const int attr)
 Basic function for writing a message with highlight attributes. More...
 
void msg_puts_attr_len (const char *const str, const ptrdiff_t len, int attr) FUNC_ATTR_NONNULL_ALL
 
void msg_printf_attr (const int attr, const char *const fmt,...) FUNC_ATTR_NONNULL_ARG(2) FUNC_ATTR_PRINTF(2
 
 msg_puts_attr_len (msgbuf,(ptrdiff_t) len, attr)
 
bool message_filtered (char_u *msg)
 
int msg_scrollsize (void)
 including horizontal separator More...
 
bool msg_use_msgsep (void)
 
bool msg_do_throttle (void)
 
void msg_scroll_up (bool may_throttle)
 Scroll the screen up one line for displaying the next message line. More...
 
void msg_scroll_flush (void)
 
void msg_reset_scroll (void)
 
void may_clear_sb_text (void)
 Finished showing messages, clear the scroll-back text on the next message. More...
 
void sb_text_start_cmdline (void)
 Starting to edit the command line, do not clear messages now. More...
 
void sb_text_end_cmdline (void)
 Ending to edit the command line. Clear old lines but the last one later. More...
 
void clear_sb_text (int all)
 
void show_sb_text (void)
 "g<" command. More...
 
void msg_sb_eol (void)
 Mark the last message chunk as finishing the line. More...
 
int msg_use_printf (void)
 
void msg_moremsg (int full)
 
void repeat_message (void)
 
void msg_clr_eos (void)
 
void msg_clr_eos_force (void)
 
void msg_clr_cmdline (void)
 Clear the command line. More...
 
int msg_end (void)
 
void msg_ext_ui_flush (void)
 
void msg_ext_flush_showmode (void)
 
void msg_ext_clear (bool force)
 
void msg_ext_clear_later (void)
 
void msg_ext_check_clear (void)
 
bool msg_ext_is_visible (void)
 
void msg_check (void)
 
int redirecting (void)
 
void verbose_enter (void)
 
void verbose_leave (void)
 
void verbose_enter_scroll (void)
 Like verbose_enter() and set msg_scroll when displaying the message. More...
 
void verbose_leave_scroll (void)
 Like verbose_leave() and set cmdline_row when displaying the message. More...
 
void verbose_stop (void)
 Called when 'verbosefile' is set: stop writing to the file. More...
 
int verbose_open (void)
 
void give_warning (char_u *message, bool hl) FUNC_ATTR_NONNULL_ARG(1)
 
void give_warning2 (char_u *const message, char_u *const a1, bool hl)
 
void msg_advance (int col)
 Advance msg cursor to column "col". More...
 
int do_dialog (int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield, int ex_cmd)
 
void display_confirm_msg (void)
 Display the ":confirm" message. Also called when screen resized. More...
 
int vim_dialog_yesno (int type, char_u *title, char_u *message, int dflt)
 
int vim_dialog_yesnocancel (int type, char_u *title, char_u *message, int dflt)
 
int vim_dialog_yesnoallcancel (int type, char_u *title, char_u *message, int dflt)
 

Variables

MessageHistoryEntryfirst_msg_hist = NULL
 First message. More...
 
MessageHistoryEntrylast_msg_hist = NULL
 Last message. More...
 
bool keep_msg_more = false
 
bool va_list ap
 
 ret = semsgv(fmt, ap)
 
char * s = xstrdup((char *)IObuff)
 
const size_t len = vim_vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap)
 
 msg_scroll = true
 

Macro Definition Documentation

◆ DLG_BUTTON_SEP

#define DLG_BUTTON_SEP   '\n'

◆ DLG_HOTKEY_CHAR

#define DLG_HOTKEY_CHAR   '&'

◆ HAS_HOTKEY_LEN

#define HAS_HOTKEY_LEN   30

◆ HOTK_LEN

#define HOTK_LEN   MB_MAXBYTES

◆ LINE_BUFFER_SIZE

#define LINE_BUFFER_SIZE   4096

◆ MULTILINE_BUFSIZE

#define MULTILINE_BUFSIZE   8192

Typedef Documentation

◆ msgchunk_T

typedef struct msgchunk_S msgchunk_T

Enumeration Type Documentation

◆ sb_clear_T

enum sb_clear_T
Enumerator
SB_CLEAR_NONE 
SB_CLEAR_ALL 
SB_CLEAR_CMDLINE_BUSY 
SB_CLEAR_CMDLINE_DONE 

Function Documentation

◆ add_hl_msg_hist()

void add_hl_msg_hist ( HlMessage  hl_msg)

◆ clear_hl_msg()

void clear_hl_msg ( HlMessage *  hl_msg)

◆ clear_sb_text()

void clear_sb_text ( int  all)

Clear any text remembered for scrolling back. When "all" is FALSE keep the last line. Called when redrawing the screen.

◆ delete_first_msg()

int delete_first_msg ( void  )

Delete the first (oldest) message from the history.

Returns
FAIL if there are no messages.

◆ display_confirm_msg()

void display_confirm_msg ( void  )

Display the ":confirm" message. Also called when screen resized.

◆ do_dialog()

int do_dialog ( int  type,
char_u title,
char_u message,
char_u buttons,
int  dfltbutton,
char_u textfield,
int  ex_cmd 
)

Used for "confirm()" function, and the :confirm command prefix. Versions which haven't got flexible dialogs yet, and console versions, get this generic handler which uses the command line.

type = one of: VIM_QUESTION, VIM_INFO, VIM_WARNING, VIM_ERROR or VIM_GENERIC title = title string (can be NULL for default) (neither used in console dialogs at the moment)

Format of the "buttons" string: "Button1Name\nButton2Name\nButton3Name" The first button should normally be the default/accept The second button should be the 'Cancel' button Other buttons- use your imagination! A '&' in a button name becomes a shortcut, so each '&' should be before a different letter.

Parameters
textfielIObuff for inputdialog(), NULL otherwise
ex_cmdwhen TRUE pressing : accepts default and starts Ex command
Returns
0 if cancelled, otherwise the nth button (1-indexed).

◆ emsg()

bool emsg ( const char *  s)

emsg() - display an error message

Rings the bell, if appropriate, and calls message() to do the real work When terminal not initialized (yet) mch_errmsg(..) is used.

Returns
true if wait_return not called

◆ emsg_invreg()

void emsg_invreg ( int  name)

◆ emsg_not_now()

int emsg_not_now ( void  )
Returns
TRUE if not giving error messages right now: If "emsg_off" is set: no error messages at the moment. If "msg" is in 'debug': do error message but without side effects. If "emsg_skip" is set: never do error messages.

◆ ex_messages()

void ex_messages ( void *const  eap_p)

:messages command implementation

◆ give_warning()

void give_warning ( char_u message,
bool  hl 
)

Give a warning message (for searching). Use 'w' highlighting and may repeat the message after redrawing

◆ give_warning2()

void give_warning2 ( char_u *const  message,
char_u *const  a1,
bool  hl 
)

◆ iemsg()

void iemsg ( const char *  s)

Same as emsg(...), but abort on error when ABORT_ON_INTERNAL_ERROR is defined. It is used for internal errors only, so that they can be detected when fuzzing vim.

◆ internal_error()

void internal_error ( char *  where)

Give an "Internal error" message.

◆ may_clear_sb_text()

void may_clear_sb_text ( void  )

Finished showing messages, clear the scroll-back text on the next message.

◆ message_filtered()

bool message_filtered ( char_u msg)
Returns
true when ":filter pattern" was used and "msg" does not match "pattern".

◆ msg() [1/2]

return msg ( (char *)  IObuff)

◆ msg() [2/2]

int msg ( char *  s)

Displays the string 's' on the status line When terminal not initialized (yet) mch_errmsg(..) is used.

Returns
TRUE if wait_return not called

◆ msg_advance()

void msg_advance ( int  col)

Advance msg cursor to column "col".

◆ msg_attr() [1/2]

return msg_attr ( (const char *)  IObuff,
attr   
)

◆ msg_attr() [2/2]

int msg_attr ( const char *  s,
const int  attr 
)

◆ msg_attr_keep() [1/2]

return msg_attr_keep ( (const char *)  IObuff,
attr  ,
true  ,
false   
)

◆ msg_attr_keep() [2/2]

bool msg_attr_keep ( const char *  s,
int  attr,
bool  keep,
bool  multiline 
)
Parameters
keepset keep_msg if it doesn't scroll

◆ msg_check()

void msg_check ( void  )

If the written message runs into the shown command or ruler, we have to wait for hit-return and redraw the window later.

◆ msg_clr_cmdline()

void msg_clr_cmdline ( void  )

Clear the command line.

◆ msg_clr_eos()

void msg_clr_eos ( void  )

Clear from current message position to end of screen. Skip this when ":silent" was used, no need to clear for redirection.

◆ msg_clr_eos_force()

void msg_clr_eos_force ( void  )

Clear from current message position to end of screen. Note: msg_col is not updated, so we remember the end of the message for msg_check().

◆ msg_do_throttle()

bool msg_do_throttle ( void  )

◆ msg_end()

int msg_end ( void  )

end putting a message on the screen call wait_return if the message does not fit in the available space

Returns
TRUE if wait_return not called.

◆ msg_end_prompt()

void msg_end_prompt ( void  )

Call this after prompting the user. This will avoid a hit-return message and a delay.

◆ msg_ext_check_clear()

void msg_ext_check_clear ( void  )

◆ msg_ext_clear()

void msg_ext_clear ( bool  force)

◆ msg_ext_clear_later()

void msg_ext_clear_later ( void  )

◆ msg_ext_flush_showmode()

void msg_ext_flush_showmode ( void  )

◆ msg_ext_is_visible()

bool msg_ext_is_visible ( void  )

◆ msg_ext_set_kind()

void msg_ext_set_kind ( const char *  msg_kind)

◆ msg_ext_ui_flush()

void msg_ext_ui_flush ( void  )

◆ msg_grid_set_pos()

void msg_grid_set_pos ( int  row,
bool  scrolled 
)

◆ msg_grid_validate()

void msg_grid_validate ( void  )

◆ msg_home_replace()

void msg_home_replace ( char_u fname)

◆ msg_home_replace_hl()

void msg_home_replace_hl ( char_u fname)

◆ msg_make()

void msg_make ( char_u arg)

◆ msg_may_trunc()

char_u* msg_may_trunc ( bool  force,
char_u s 
)

Check if message "s" should be truncated at the start (for filenames).

Returns
a pointer to where the truncated message starts.
Note
: May change the message by replacing a character with '<'.

◆ msg_moremsg()

void msg_moremsg ( int  full)

◆ msg_multiline_attr()

void msg_multiline_attr ( const char *  s,
int  attr,
bool  check_int,
bool need_clear 
)

Similar to msg_outtrans_attr, but support newlines and tabs.

◆ msg_outnum()

void msg_outnum ( long  n)

◆ msg_outtrans()

int msg_outtrans ( char_u str)

Output 'len' characters in 'str' (including NULs) with translation if 'len' is -1, output up to a NUL character. Use attributes 'attr'.

Returns
the number of characters it takes on the screen.

◆ msg_outtrans_attr()

int msg_outtrans_attr ( const char_u str,
int  attr 
)

◆ msg_outtrans_len()

int msg_outtrans_len ( const char_u str,
int  len 
)

◆ msg_outtrans_len_attr()

int msg_outtrans_len_attr ( const char_u msgstr,
int  len,
int  attr 
)

◆ msg_outtrans_long_attr()

void msg_outtrans_long_attr ( char_u longstr,
int  attr 
)

Show a message in such a way that it always fits in the line. Cut out a part in the middle and replace it with "..." when necessary. Does not handle multi-byte characters!

◆ msg_outtrans_long_len_attr()

void msg_outtrans_long_len_attr ( char_u longstr,
int  len,
int  attr 
)

◆ msg_outtrans_one()

char_u* msg_outtrans_one ( char_u p,
int  attr 
)

Output one character at "p". Handles multi-byte characters.

Returns
pointer to the next character.

◆ msg_outtrans_special()

int msg_outtrans_special ( const char_u strstart,
bool  from,
int  maxlen 
)

Output the string 'str' up to a NUL character. Return the number of characters it takes on the screen.

If K_SPECIAL is encountered, then it is taken in conjunction with the following character and shown as <F1>, <S-Up> etc. Any other character which is not printable shown in <> form. If 'from' is TRUE (lhs of a mapping), a space is shown as <Space>. If a character is displayed in one of these special ways, is also highlighted (its highlight name is '8' in the p_hl variable). Otherwise characters are not highlighted. This function is used to show mappings, where we want to see how to type the character/string – webb

Parameters
fromtrue for LHS of a mapping
maxlenscreen columns, 0 for unlimited

◆ msg_printf_attr()

void msg_printf_attr ( const int  attr,
const char *const  fmt,
  ... 
)

Print a formatted message

Message printed is limited by IOSIZE. Must not be used from inside msg_puts_attr().

Parameters
[in]attrHighlight attributes.
[in]fmtFormat string.

◆ msg_prt_line()

void msg_prt_line ( char_u s,
int  list 
)

print line for :print or :list command

◆ msg_putchar()

void msg_putchar ( int  c)

◆ msg_putchar_attr()

void msg_putchar_attr ( int  c,
int  attr 
)

◆ msg_puts()

void msg_puts ( const char *  s)

Output a string to the screen at position msg_row, msg_col. Update msg_row and msg_col for the next message.

◆ msg_puts_attr()

void msg_puts_attr ( const char *const  s,
const int  attr 
)

Basic function for writing a message with highlight attributes.

◆ msg_puts_attr_len() [1/2]

void msg_puts_attr_len ( const char *const  str,
const ptrdiff_t  len,
int  attr 
)

Write a message with highlight attributes

Parameters
[in]strNUL-terminated message string.
[in]lenLength of the string or -1.
[in]attrHighlight attribute.

◆ msg_puts_attr_len() [2/2]

msg_puts_attr_len ( msgbuf  ,
(ptrdiff_t)  len,
attr   
)

◆ msg_puts_title()

void msg_puts_title ( const char *  s)

◆ msg_reset_scroll()

void msg_reset_scroll ( void  )

◆ msg_sb_eol()

void msg_sb_eol ( void  )

Mark the last message chunk as finishing the line.

◆ msg_schedule_semsg()

void msg_schedule_semsg ( const char *const  fmt,
  ... 
)

◆ msg_scroll_flush()

void msg_scroll_flush ( void  )

Send throttled message output to UI clients

The way message.c uses the grid_xx family of functions is quite inefficient relative to the "gridline" UI protocol used by TUI and modern clients. For instance scrolling is done one line at a time. By throttling drawing on the message grid, we can coalesce scrolling to a single grid_scroll per screen update.

NB: The bookkeeping is quite messy, and rests on a bunch of poorly documented assumptions. For instance that the message area always grows while being throttled, messages are only being output on the last line etc.

Probably message scrollback storage should be reimplemented as a file_buffer, and message scrolling in TUI be reimplemented as a modal floating window. Then we get throttling "for free" using standard redraw_later code paths.

◆ msg_scroll_up()

void msg_scroll_up ( bool  may_throttle)

Scroll the screen up one line for displaying the next message line.

◆ msg_scrollsize()

int msg_scrollsize ( void  )

including horizontal separator

◆ msg_source()

void msg_source ( int  attr)

Display name and line number for the source of an error. Remember the file name and line number, so that for the next error the info is only displayed if it changed.

◆ msg_start()

void msg_start ( void  )

Prepare for outputting characters in the command line.

◆ msg_starthere()

void msg_starthere ( void  )

Note that the current msg position is where messages start.

◆ msg_strtrunc()

char_u* msg_strtrunc ( char_u s,
int  force 
)

Truncate a string such that it can be printed without causing a scroll.

Returns
an allocated string or NULL when no truncating is done.
Parameters
forcealways truncate

◆ msg_trunc_attr()

char* msg_trunc_attr ( char *  s,
bool  force,
int  attr 
)

Like msg(), but truncate to a single line if p_shm contains 't', or when "force" is true. This truncates in another way as for normal messages. Careful: The string may be changed by msg_may_trunc()!

Returns
a pointer to the printed message, if wait_return() not called.

◆ msg_use_grid()

bool msg_use_grid ( void  )

◆ msg_use_msgsep()

bool msg_use_msgsep ( void  )

◆ msg_use_printf()

int msg_use_printf ( void  )
Returns
TRUE when messages should be printed to stdout/stderr:
  • "batch mode" ("silent mode", -es/-Es)
  • no UI and not embedded

◆ msgmore()

void msgmore ( long  n)

◆ multiqueue_put()

multiqueue_put ( main_loop.  events,
msg_semsg_event  ,
,
s   
)

◆ redirecting()

int redirecting ( void  )

◆ repeat_message()

void repeat_message ( void  )

Repeat the message for the current mode: MODE_ASKMORE, MODE_EXTERNCMD, MODE_CONFIRM or exmode_active.

◆ reset_last_sourcing()

void reset_last_sourcing ( void  )

Reset the last used sourcing name/lnum. Makes sure it is displayed again for the next error message;

◆ sb_text_end_cmdline()

void sb_text_end_cmdline ( void  )

Ending to edit the command line. Clear old lines but the last one later.

◆ sb_text_start_cmdline()

void sb_text_start_cmdline ( void  )

Starting to edit the command line, do not clear messages now.

◆ semsg()

bool semsg ( const char *const  fmt,
  ... 
)

Print an error message with unknown number of arguments.

◆ semsg_multiline()

bool semsg_multiline ( const char *const  fmt,
  ... 
)

◆ set_keep_msg()

void set_keep_msg ( char *  s,
int  attr 
)

Set "keep_msg" to "s". Free the old value and check for NULL pointer.

◆ show_sb_text()

void show_sb_text ( void  )

"g<" command.

◆ siemsg()

void siemsg ( const char *  s,
  ... 
)

Same as semsg(...) but abort on error when ABORT_ON_INTERNAL_ERROR is defined. It is used for internal errors only, so that they can be detected when fuzzing vim.

◆ smsg()

int smsg ( const char *  s,
  ... 
)

◆ smsg_attr()

int smsg_attr ( int  attr,
const char *  s,
  ... 
)

◆ smsg_attr_keep()

int smsg_attr_keep ( int  attr,
const char *  s,
  ... 
)

◆ str2special()

const char* str2special ( const char **const  sp,
const bool  replace_spaces,
const bool  replace_lt 
)

Convert character, replacing key with printable representation.

Parameters
[in,out]spString to convert. Is advanced to the next key code.
[in]replace_spacesConvert spaces into <Space>, normally used for lhs, but not rhs.
[in]replace_ltConvert < into <lt>.
Returns
Converted key code, in a static buffer. Buffer is always one and the same, so save converted string somewhere before running str2special for the second time. On illegal byte return a string with only that byte.

◆ str2special_save()

char* str2special_save ( const char *const  str,
const bool  replace_spaces,
const bool  replace_lt 
)

Convert string, replacing key codes with printables

Used for lhs or rhs of mappings.

Parameters
[in]strString to convert.
[in]replace_spacesConvert spaces into <Space>, normally used fo lhs, but not rhs.
[in]replace_ltConvert < into <lt>.
Returns
[allocated] Converted string.

◆ str2specialbuf()

void str2specialbuf ( const char *  sp,
char *  buf,
size_t  len 
)

Convert string, replacing key codes with printables

Parameters
[in]strString to convert.
[out]bufBuffer to save results to.
[in]lenBuffer length.

◆ trunc_string()

void trunc_string ( char_u s,
char_u buf,
int  room_in,
int  buflen 
)

Truncate a string "s" to "buf" with cell width "room". "s" and "buf" may be equal.

◆ va_end() [1/2]

va_end ( ap  )

◆ va_end() [2/2]

va_end ( arglist  )

◆ va_start() [1/2]

va_start ( ap  ,
fmt   
)
Initial value:
{
va_list ap

◆ va_start() [2/2]

int va_start ( arglist  ,
s   
)
Initial value:
{
va_list arglist

◆ verb_msg()

int verb_msg ( char *  s)

Like msg() but keep it silent when 'verbosefile' is set.

◆ verbose_enter()

void verbose_enter ( void  )

Before giving verbose message. Must always be called paired with verbose_leave()!

◆ verbose_enter_scroll()

void verbose_enter_scroll ( void  )

Like verbose_enter() and set msg_scroll when displaying the message.

◆ verbose_leave()

void verbose_leave ( void  )

After giving verbose message. Must always be called paired with verbose_enter()!

◆ verbose_leave_scroll()

void verbose_leave_scroll ( void  )

Like verbose_leave() and set cmdline_row when displaying the message.

◆ verbose_open()

int verbose_open ( void  )

Open the file 'verbosefile'.

Returns
FAIL or OK.

◆ verbose_stop()

void verbose_stop ( void  )

Called when 'verbosefile' is set: stop writing to the file.

◆ vim_dialog_yesno()

int vim_dialog_yesno ( int  type,
char_u title,
char_u message,
int  dflt 
)

◆ vim_dialog_yesnoallcancel()

int vim_dialog_yesnoallcancel ( int  type,
char_u title,
char_u message,
int  dflt 
)

◆ vim_dialog_yesnocancel()

int vim_dialog_yesnocancel ( int  type,
char_u title,
char_u message,
int  dflt 
)

◆ vim_vsnprintf() [1/2]

vim_vsnprintf ( (char *)  IObuff,
IOSIZE  ,
fmt  ,
ap   
)

◆ vim_vsnprintf() [2/2]

vim_vsnprintf ( (char *)  IObuff,
IOSIZE  ,
s  ,
arglist   
)

◆ wait_return()

void wait_return ( int  redraw)

Wait for the user to hit a key (normally Enter)

Parameters
redrawif true, redraw the entire screen NOT_VALID if false, do a normal redraw if -1, don't redraw at all

Variable Documentation

◆ ap

int va_list ap
Initial value:
{
bool ret

◆ first_msg_hist

MessageHistoryEntry* first_msg_hist = NULL

First message.

◆ keep_msg_more

bool keep_msg_more = false

◆ last_msg_hist

MessageHistoryEntry* last_msg_hist = NULL

Last message.

◆ len

const size_t len = vim_vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap)

◆ msg_scroll

msg_scroll = true

◆ ret

return ret = semsgv(fmt, ap)

◆ s

char* s = xstrdup((char *)IObuff)
ap
bool va_list ap
Definition: message.c:743
ret
ret
Definition: message.c:748
arglist
Definition: buffer_defs.h:296