#include <inttypes.h>
#include <stdbool.h>
#include "nvim/func_attr.h"
#include "nvim/getchar.h"
#include "nvim/input.h"
#include "nvim/mbyte.h"
#include "nvim/memory.h"
#include "nvim/mouse.h"
#include "nvim/os/input.h"
#include "nvim/ui.h"
#include "nvim/vim.h"
Functions | |
int | ask_yesno (const char *const str, const bool direct) |
int | get_keystroke (MultiQueue *events) |
int | get_number (int colon, int *mouse_used) |
int | prompt_for_number (int *mouse_used) |
int ask_yesno | ( | const char *const | str, |
const bool | direct | ||
) |
Ask for a reply from the user, 'y' or 'n'
No other characters are accepted, the message is repeated until a valid reply is entered or <C-c> is hit.
[in] | str | Prompt: question to ask user. Is always followed by " (y/n)?". |
[in] | direct | Determines what function to use to get user input. If true then ui_inchar() will be used, otherwise vgetc(). I.e. when direct is true then characters are obtained directly from the user without buffers involved. |
int get_keystroke | ( | MultiQueue * | events | ) |
Get a key stroke directly from the user.
Ignores mouse clicks and scrollbar events, except a click for the left button (used at the more prompt). Doesn't use vgetc(), because it syncs undo and eats mapped characters. Disadvantage: typeahead is ignored. Translates the interrupt character for unix to ESC.
int get_number | ( | int | colon, |
int * | mouse_used | ||
) |
Get a number from the user. When "mouse_used" is not NULL allow using the mouse.
colon | allow colon to abort |
int prompt_for_number | ( | int * | mouse_used | ) |
Ask the user to enter a number.
When "mouse_used" is not NULL allow using the mouse and in that case return the line number.