Macros | Functions
misc1.c File Reference
#include <assert.h>
#include <inttypes.h>
#include <limits.h>
#include <stdbool.h>
#include <string.h>
#include "nvim/ascii.h"
#include "nvim/buffer.h"
#include "nvim/buffer_updates.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
#include "nvim/diff.h"
#include "nvim/edit.h"
#include "nvim/eval.h"
#include "nvim/event/stream.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_getln.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/func_attr.h"
#include "nvim/garray.h"
#include "nvim/getchar.h"
#include "nvim/indent.h"
#include "nvim/indent_c.h"
#include "nvim/main.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/misc1.h"
#include "nvim/mouse.h"
#include "nvim/move.h"
#include "nvim/option.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
#include "nvim/os/shell.h"
#include "nvim/os/signal.h"
#include "nvim/os/time.h"
#include "nvim/os_unix.h"
#include "nvim/quickfix.h"
#include "nvim/regexp.h"
#include "nvim/screen.h"
#include "nvim/search.h"
#include "nvim/state.h"
#include "nvim/strings.h"
#include "nvim/tag.h"
#include "nvim/ui.h"
#include "nvim/undo.h"
#include "nvim/vim.h"
#include "nvim/window.h"

Macros

#define BREAKCHECK_SKIP   1000
 

Functions

int get_leader_len (char_u *line, char_u **flags, bool backward, bool include_space)
 
int get_last_leader_offset (char_u *line, char_u **flags)
 
int gchar_pos (pos_T *pos) FUNC_ATTR_NONNULL_ARG(1)
 
void check_status (buf_T *buf)
 
int ask_yesno (const char *const str, const bool direct)
 
int is_mouse_key (int c)
 
int get_keystroke (MultiQueue *events)
 
int get_number (int colon, int *mouse_used)
 
int prompt_for_number (int *mouse_used)
 
void msgmore (long n)
 
void beep_flush (void)
 
void vim_beep (unsigned val)
 
char_uget_users (expand_T *xp, int idx)
 
int match_user (char_u *name)
 
void preserve_exit (void)
 
void line_breakcheck (void)
 
void fast_breakcheck (void)
 
void veryfast_breakcheck (void)
 
int call_shell (char_u *cmd, ShellOpts opts, char_u *extra_shell_arg)
 
char_uget_cmd_output (char_u *cmd, char_u *infile, ShellOpts flags, size_t *ret_len)
 
void FreeWild (int count, char_u **files)
 
int goto_im (void)
 
void add_time (char_u *buf, size_t buflen, time_t tt)
 Put the timestamp of an undo header in "buf[buflen]" in a nice format. More...
 

Macro Definition Documentation

◆ BREAKCHECK_SKIP

#define BREAKCHECK_SKIP   1000

Function Documentation

◆ add_time()

void add_time ( char_u buf,
size_t  buflen,
time_t  tt 
)

Put the timestamp of an undo header in "buf[buflen]" in a nice format.

◆ ask_yesno()

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.

Parameters
[in]strPrompt: question to ask user. Is always followed by " (y/n)?".
[in]directDetermines 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.
Returns
'y' or 'n'. Last is also what will be returned in case of interrupt.

◆ beep_flush()

void beep_flush ( void  )

◆ call_shell()

int call_shell ( char_u cmd,
ShellOpts  opts,
char_u extra_shell_arg 
)

os_call_shell() wrapper. Handles 'verbose', :profile, and v:shell_error. Invalidates cached tags.

Returns
shell command exit code

◆ check_status()

void check_status ( buf_T buf)

◆ fast_breakcheck()

void fast_breakcheck ( void  )

◆ FreeWild()

void FreeWild ( int  count,
char_u **  files 
)

◆ gchar_pos()

int gchar_pos ( pos_T pos)

◆ get_cmd_output()

char_u* get_cmd_output ( char_u cmd,
char_u infile,
ShellOpts  flags,
size_t *  ret_len 
)

Get the stdout of an external command. If "ret_len" is NULL replace NUL characters with NL. When "ret_len" is not NULL store the length there.

Parameters
cmdcommand to execute
infileoptional input file name
flagscan be kShellOptSilent or 0
ret_lenlength of the stdout
Returns
an allocated string, or NULL for error.

◆ get_keystroke()

int get_keystroke ( MultiQueue events)

◆ get_last_leader_offset()

int get_last_leader_offset ( char_u line,
char_u **  flags 
)

◆ get_leader_len()

int get_leader_len ( char_u line,
char_u **  flags,
bool  backward,
bool  include_space 
)

◆ get_number()

int get_number ( int  colon,
int *  mouse_used 
)

Get a number from the user. When "mouse_used" is not NULL allow using the mouse.

Parameters
colonallow colon to abort

◆ get_users()

char_u* get_users ( expand_T xp,
int  idx 
)

◆ goto_im()

int goto_im ( void  )

◆ is_mouse_key()

int is_mouse_key ( int  c)

◆ line_breakcheck()

void line_breakcheck ( void  )

◆ match_user()

int match_user ( char_u name)

◆ msgmore()

void msgmore ( long  n)

◆ preserve_exit()

void preserve_exit ( void  )

Preserve files and exit.

Note
IObuff must contain a message.
This may be called from deadly_signal() in a signal handler, avoid unsafe functions, such as allocating memory.

◆ prompt_for_number()

int prompt_for_number ( int *  mouse_used)

◆ veryfast_breakcheck()

void veryfast_breakcheck ( void  )

◆ vim_beep()

void vim_beep ( unsigned  val)