Macros | Functions
misc1.c File Reference
#include <assert.h>
#include <inttypes.h>
#include <stdbool.h>
#include <string.h>
#include <limits.h>
#include "nvim/vim.h"
#include "nvim/ascii.h"
#include "nvim/misc1.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
#include "nvim/diff.h"
#include "nvim/edit.h"
#include "nvim/eval.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_getln.h"
#include "nvim/fileio.h"
#include "nvim/func_attr.h"
#include "nvim/fold.h"
#include "nvim/getchar.h"
#include "nvim/indent.h"
#include "nvim/indent_c.h"
#include "nvim/buffer_updates.h"
#include "nvim/main.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/message.h"
#include "nvim/garray.h"
#include "nvim/move.h"
#include "nvim/mouse.h"
#include "nvim/option.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/window.h"
#include "nvim/os/os.h"
#include "nvim/os/shell.h"
#include "nvim/os/signal.h"
#include "nvim/os/input.h"
#include "nvim/os/time.h"
#include "nvim/event/stream.h"
#include "nvim/buffer.h"


#define BREAKCHECK_SKIP   1000


int get_leader_len (char_u *line, char_u **flags, int backward, int include_space)
int get_last_leader_offset (char_u *line, char_u **flags)
int plines (const linenr_T lnum)
int plines_win (win_T *const wp, const linenr_T lnum, const bool winheight)
int plines_nofill (const linenr_T lnum)
int plines_win_nofill (win_T *const wp, const linenr_T lnum, const bool winheight)
int plines_win_nofold (win_T *wp, linenr_T lnum)
int plines_win_col (win_T *wp, linenr_T lnum, long column)
int plines_win_full (win_T *wp, linenr_T lnum, linenr_T *const nextp, bool *const foldedp, const bool cache)
int plines_m_win (win_T *wp, linenr_T first, linenr_T last)
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)
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)

Macro Definition Documentation

#define BREAKCHECK_SKIP   1000

Function Documentation

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]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.
'y' or 'n'. Last is also what will be returned in case of interrupt.
void beep_flush ( void  )
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.

shell command exit code
void check_status ( buf_T buf)
void fast_breakcheck ( void  )
void FreeWild ( int  count,
char_u **  files 
int gchar_pos ( pos_T pos)
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.

cmdcommand to execute
infileoptional input file name
flagscan be kShellOptSilent or 0
ret_lenlength of the stdout
an allocated string, or NULL for error.
int get_keystroke ( MultiQueue events)
int get_last_leader_offset ( char_u line,
char_u **  flags 
int get_leader_len ( char_u line,
char_u **  flags,
int  backward,
int  include_space 
int get_number ( int  colon,
int *  mouse_used 
char_u* get_users ( expand_T xp,
int  idx 
int goto_im ( void  )
int is_mouse_key ( int  c)
void line_breakcheck ( void  )
int match_user ( char_u name)
void msgmore ( long  n)
int plines ( const linenr_T  lnum)
int plines_m_win ( win_T wp,
linenr_T  first,
linenr_T  last 
int plines_nofill ( const linenr_T  lnum)
int plines_win ( win_T *const  wp,
const linenr_T  lnum,
const bool  winheight 
int plines_win_col ( win_T wp,
linenr_T  lnum,
long  column 
int plines_win_full ( win_T wp,
linenr_T  lnum,
linenr_T *const  nextp,
bool *const  foldedp,
const bool  cache 

Get the number of screen lines lnum takes up. This takes care of both folds and topfill, and limits to the current window height.

[in]wpwindow line is in
[in]lnumline number
[out]nextpif not NULL, the line after a fold
[out]foldedpif not NULL, whether lnum is on a fold
[in]cachewhether to use the window's cache for folds
the total number of screen lines
int plines_win_nofill ( win_T *const  wp,
const linenr_T  lnum,
const bool  winheight 
int plines_win_nofold ( win_T wp,
linenr_T  lnum 
void preserve_exit ( void  )

Preserve files and exit.

IObuff must contain a message.
This may be called from deadly_signal() in a signal handler, avoid unsafe functions, such as allocating memory.
int prompt_for_number ( int *  mouse_used)
void vim_beep ( unsigned  val)