Search notes:

vim - src/getchar.c

Functions related with getting a character from the user/mapping/redo/…
Manipulations with redo buffer and stuff buffer mappings and abbreviations

buffheader_T variables

getchar.c declares some variables whose type is buffheader_T.
static buffheader_T redobuff     = {{NULL, {NUL}}, NULL, 0, 0};
static buffheader_T old_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
static buffheader_T recordbuff   = {{NULL, {NUL}}, NULL, 0, 0};

…

static buffheader_T readbuf1     = {{NULL, {NUL}}, NULL, 0, 0};// First read ahead buffer. Used for translated commands.
static buffheader_T readbuf2     = {{NULL, {NUL}}, NULL, 0, 0};// Second read ahead buffer. Used for redo.

vgetc()

Get the next input character.
Can return a special key or a multi-byte character.
Can return NUL when called recursively, use safe_vgetc() if that's not wanted.
This translates escaped K_SPECIAL and CSI bytes to a K_SPECIAL or CSI byte.
Collects the bytes of a multibyte character into the whole character.
Returns the modifiers in the global "mod_mask".

safe_vgetc()

Like vgetc(), but never returns a NUL when called recursively, get a key directly from the user (ignoring typeahead).
If there is no new character after updatetime, safe_vgetc returns K_CURSORHOLD.

vgetorpeek(int advance)

Get a «byte».
If advance is TRUE:
If advance is FALSE, it is only checked whtere a character is available. If not, NUL is returned.
TODO: function might call handle_mapping.

ins_typebuf()

Inserts a string at a given position (offset) into the typeahead buffer.

inchar()

Gets a character either from a script file or the keyboard
Compare with the similarly sounding function inchar_loop()

flush_buffers()

flush_buffers() removes the contents of the stuff buffer and the mapped characters in the typeahead buffer.
vim.h define the enum flush_buffers_T which specifies the possible arguments for flush_buffers():
typedef enum {
    FLUSH_MINIMAL,
    FLUSH_TYPEAHEAD, // flush current typebuf contents
    FLUSH_INPUT      // flush typebuf and inchar() input
} flush_buffers_T;

inchar()

inchar() gets one character from a script file or the keyboard.

input_available()

Return TRUE when bytes are in the input buffer or in the typeahead buffer.
Normally the input buffer would be sufficient, but the server_to_input_buf() or feedkeys() may insert characters in the typeahead buffer while we are waiting for input to arrive.

read_readbuffers()

Gets one byte from the read buffers.

stuffcharReadbuff()

Appends a character to the stuff buffer by calling
add_char_buff(&readbuf1, c);
In the declaration of readbuf1, the variable is called First read ahead buffer. Used for translated commands.

Index