#include <assert.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include "nvim/api/private/helpers.h"
#include "nvim/ascii.h"
#include "nvim/buffer.h"
#include "nvim/change.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
#include "nvim/debugger.h"
#include "nvim/diff.h"
#include "nvim/digraph.h"
#include "nvim/edit.h"
#include "nvim/eval.h"
#include "nvim/eval/userfunc.h"
#include "nvim/event/rstream.h"
#include "nvim/event/wstream.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_cmds2.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
#include "nvim/ex_getln.h"
#include "nvim/ex_session.h"
#include "nvim/file_search.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/func_attr.h"
#include "nvim/garray.h"
#include "nvim/getchar.h"
#include "nvim/globals.h"
#include "nvim/hardcopy.h"
#include "nvim/highlight_group.h"
#include "nvim/if_cscope.h"
#include "nvim/input.h"
#include "nvim/keycodes.h"
#include "nvim/lua/executor.h"
#include "nvim/main.h"
#include "nvim/mark.h"
#include "nvim/match.h"
#include "nvim/mbyte.h"
#include "nvim/memline.h"
#include "nvim/memory.h"
#include "nvim/menu.h"
#include "nvim/message.h"
#include "nvim/mouse.h"
#include "nvim/move.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/os_unix.h"
#include "nvim/path.h"
#include "nvim/quickfix.h"
#include "nvim/regexp.h"
#include "nvim/screen.h"
#include "nvim/search.h"
#include "nvim/shada.h"
#include "nvim/sign.h"
#include "nvim/spell.h"
#include "nvim/spellfile.h"
#include "nvim/state.h"
#include "nvim/strings.h"
#include "nvim/syntax.h"
#include "nvim/tag.h"
#include "nvim/terminal.h"
#include "nvim/ui.h"
#include "nvim/undo.h"
#include "nvim/undo_defs.h"
#include "nvim/version.h"
#include "nvim/vim.h"
#include "nvim/window.h"
Data Structures | |
struct | wcmd_T |
struct | loop_cookie |
struct | dbg_stuff |
struct | cmdmod |
Macros | |
#define | IS_USER_CMDIDX(idx) ((int)(idx) < 0) |
#define | FREE_WCMD(wcmd) xfree((wcmd)->line) |
#define | ex_language ex_ni |
#define | CURRENT_WIN_NR current_win_nr(curwin) |
#define | LAST_WIN_NR current_win_nr(NULL) |
#define | CURRENT_TAB_NR current_tab_nr(curtab) |
#define | LAST_TAB_NR current_tab_nr(NULL) |
#define | ERROR(msg) |
#define | ESCAPE_CHARS escape_chars |
#define | FREE_AENTRY_FNAME(arg) xfree(arg->ae_fname) |
Enumerations | |
enum | { SPEC_PERC = 0, SPEC_HASH, SPEC_CWORD, SPEC_CCWORD, SPEC_CEXPR, SPEC_CFILE, SPEC_SFILE, SPEC_SLNUM, SPEC_STACK, SPEC_AFILE, SPEC_ABUF, SPEC_AMATCH, SPEC_SFLNUM, SPEC_SID } |
Functions | |
void | do_exmode (void) |
Repeatedly get commands for Ex mode, until the ":vi" command is given. More... | |
int | do_cmdline_cmd (const char *cmd) |
Execute a simple command line. Used for translated commands like "*". More... | |
int | do_cmdline (char *cmdline, LineGetter fgetline, void *cookie, int flags) |
int | getline_equal (LineGetter fgetline, void *cookie, LineGetter func) |
void * | getline_cookie (LineGetter fgetline, void *cookie) |
void | set_cmd_addr_type (exarg_T *eap, char_u *p) |
linenr_T | get_cmd_default_range (exarg_T *eap) |
Get default range number for command based on its address type. More... | |
void | set_cmd_dflall_range (exarg_T *eap) |
Set default command range for -range=% based on the addr type of the command. More... | |
void | set_cmd_count (exarg_T *eap, long count, bool validate) |
bool | is_cmd_ni (cmdidx_T cmdidx) |
Check if command is not implemented. More... | |
bool | parse_cmdline (char *cmdline, exarg_T *eap, CmdParseInfo *cmdinfo, char **errormsg) |
void | execute_cmd (exarg_T *eap, CmdParseInfo *cmdinfo) |
char * | ex_errmsg (const char *const msg, const char *const arg) FUNC_ATTR_NONNULL_ALL |
int | parse_command_modifiers (exarg_T *eap, char **errormsg, bool skip_only) |
int | parse_cmd_address (exarg_T *eap, char **errormsg, bool silent) FUNC_ATTR_NONNULL_ALL |
int | checkforcmd (char **pp, char *cmd, int len) |
char * | find_ex_command (exarg_T *eap, int *full) FUNC_ATTR_NONNULL_ARG(1) |
int | modifier_len (char *cmd) |
int | cmd_exists (const char *const name) |
void | f_fullcommand (typval_T *argvars, typval_T *rettv, FunPtr fptr) |
"fullcommand" function More... | |
const char * | set_one_cmd_context (expand_T *xp, const char *buff) |
char * | skip_range (const char *cmd, int *ctx) |
void | ex_ni (exarg_T *eap) |
Stub function for command which is Not Implemented. NI! More... | |
char * | invalid_range (exarg_T *eap) |
char * | replace_makeprg (exarg_T *eap, char *p, char **cmdlinep) |
int | expand_filename (exarg_T *eap, char_u **cmdlinep, char **errormsgp) |
void | separate_nextcmd (exarg_T *eap) |
Check for '|' to separate commands and '"' to start comments. More... | |
int | get_bad_opt (const char_u *p, exarg_T *eap) FUNC_ATTR_NONNULL_ALL |
int | ends_excmd (int c) FUNC_ATTR_CONST |
char_u * | find_nextcmd (const char_u *p) |
char_u * | check_nextcmd (char_u *p) |
char * | get_command_name (expand_T *xp, int idx) |
Function given to ExpandGeneric() to obtain the list of command names. More... | |
char * | uc_validate_name (char *name) |
int | uc_add_command (char *name, size_t name_len, char *rep, uint32_t argt, long def, int flags, int compl, char *compl_arg, LuaRef compl_luaref, cmd_addr_T addr_type, LuaRef luaref, bool force) FUNC_ATTR_NONNULL_ARG(1 |
replace_termcodes (rep, STRLEN(rep), &rep_buf, 0, NULL, CPO_TO_CPO_FLAGS) | |
if (rep_buf==NULL) | |
if (flags &UC_BUFFER) | |
for (i=0;i< gap->ga_len;++i) | |
if (cmp !=0) | |
xfree (compl_arg) | |
NLUA_CLEAR_REF (luaref) | |
NLUA_CLEAR_REF (compl_luaref) | |
void | ex_comclear (exarg_T *eap) |
void | free_ucmd (ucmd_T *cmd) |
void | uc_clear (garray_T *gap) |
Clear all user commands for "gap". More... | |
bool | uc_split_args_iter (const char *arg, size_t arglen, size_t *end, char *buf, size_t *len) |
size_t | uc_mods (char *buf) |
char * | get_user_cmd_addr_type (expand_T *xp, int idx) |
Function given to ExpandGeneric() to obtain the list of user address type names. More... | |
char * | get_user_commands (expand_T *xp FUNC_ATTR_UNUSED, int idx) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT |
Function given to ExpandGeneric() to obtain the list of user command names. More... | |
char * | get_user_cmd_flags (expand_T *xp, int idx) |
char * | get_user_cmd_nargs (expand_T *xp, int idx) |
Function given to ExpandGeneric() to obtain the list of values for -nargs. More... | |
char * | get_user_cmd_complete (expand_T *xp, int idx) |
Function given to ExpandGeneric() to obtain the list of values for -complete. More... | |
int | parse_addr_type_arg (char *value, int vallen, cmd_addr_T *addr_type_arg) FUNC_ATTR_NONNULL_ALL |
Parse address type argument. More... | |
int | parse_compl_arg (const char *value, int vallen, int *complp, uint32_t *argt, char **compl_arg) FUNC_ATTR_NONNULL_ALL |
int | cmdcomplete_str_to_type (const char *complete_str) |
void | not_exiting (void) |
bool | before_quit_autocmds (win_T *wp, bool quit_all, bool forceit) |
void | ex_win_close (int forceit, win_T *win, tabpage_T *tp) |
void | tabpage_close (int forceit) |
Close the current tab page. More... | |
void | tabpage_close_other (tabpage_T *tp, int forceit) |
void | ex_all (exarg_T *eap) |
void | alist_clear (alist_T *al) |
Clear an argument list: free all file names and reset it to zero entries. More... | |
void | alist_init (alist_T *al) |
Init an argument list. More... | |
void | alist_unlink (alist_T *al) |
void | alist_new (void) |
Create a new argument list and use it for the current window. More... | |
void | alist_expand (int *fnum_list, int fnum_len) |
void | alist_set (alist_T *al, int count, char **files, int use_curbuf, int *fnum_list, int fnum_len) |
void | alist_add (alist_T *al, char *fname, int set_fnum) |
void | ex_splitview (exarg_T *eap) |
void | tabpage_new (void) |
Open a new tab page. More... | |
void | do_exedit (exarg_T *eap, win_T *old_curwin) |
bool | changedir_func (char *new_dir, CdScope scope) |
void | ex_cd (exarg_T *eap) |
":cd", ":tcd", ":lcd", ":chdir", "tchdir" and ":lchdir". More... | |
void | do_sleep (long msec) |
Sleep for "msec" milliseconds, but keep checking for a CTRL-C every second. More... | |
void | ex_may_print (exarg_T *eap) |
Print the current line if flags were given to the Ex command. More... | |
int | vim_mkdir_emsg (const char *const name, const int prot) FUNC_ATTR_NONNULL_ALL |
FILE * | open_exfile (char_u *fname, int forceit, char *mode) |
void | update_topline_cursor (void) |
Update w_topline, w_leftcol and the cursor position. More... | |
bool | save_current_state (save_state_T *sst) FUNC_ATTR_NONNULL_ALL |
void | restore_current_state (save_state_T *sst) FUNC_ATTR_NONNULL_ALL |
void | exec_normal_cmd (char_u *cmd, int remap, bool silent) |
void | exec_normal (bool was_typed) |
ssize_t | find_cmdline_var (const char_u *src, size_t *usedlen) FUNC_ATTR_NONNULL_ALL |
char_u * | eval_vars (char_u *src, char_u *srcstart, size_t *usedlen, linenr_T *lnump, char **errormsg, int *escaped) |
char * | expand_sfile (char *arg) |
void | dialog_msg (char *buff, char *format, char *fname) |
char * | get_behave_arg (expand_T *xp, int idx) |
char * | get_messages_arg (expand_T *xp FUNC_ATTR_UNUSED, int idx) |
char * | get_mapclear_arg (expand_T *xp FUNC_ATTR_UNUSED, int idx) |
void | filetype_plugin_enable (void) |
void | filetype_maybe_enable (void) |
Enable filetype detection if the user did not explicitly disable it. More... | |
void | set_no_hlsearch (bool flag) |
bool | is_loclist_cmd (int cmdidx) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT |
bool | get_pressedreturn (void) |
void | set_pressedreturn (bool val) |
bool | cmd_can_preview (char *cmd) |
Dictionary | commands_array (buf_T *buf) |
void | verify_command (char *cmd) |
uint32_t | get_cmd_argt (cmdidx_T cmdidx) |
Get argt of command with id. More... | |
Variables | |
garray_T | ucmds = { 0, 0, sizeof(ucmd_T), 4, NULL } |
int int | i |
int | cmp = 1 |
char * | rep_buf = NULL |
garray_T * | gap |
else | |
cmd | uc_rep = (char_u *)rep_buf |
cmd | uc_argt = argt |
cmd | uc_def = def |
cmd | uc_compl = compl |
cmd | uc_script_ctx = current_sctx |
cmd uc_script_ctx | sc_lnum = sourcing_lnum |
nlua_set_sctx & | cmd |
cmd | uc_compl_arg = (char_u *)compl_arg |
cmd | uc_compl_luaref = compl_luaref |
cmd | uc_addr_type = addr_type |
cmd | uc_luaref = luaref |
return | OK |
fail | __pad0__ |
return | FAIL |
#define CURRENT_TAB_NR current_tab_nr(curtab) |
#define CURRENT_WIN_NR current_win_nr(curwin) |
#define ESCAPE_CHARS escape_chars |
#define ex_language ex_ni |
#define IS_USER_CMDIDX | ( | idx | ) | ((int)(idx) < 0) |
#define LAST_TAB_NR current_tab_nr(NULL) |
#define LAST_WIN_NR current_win_nr(NULL) |
anonymous enum |
Add file "fname" to argument list "al". "fname" must have been allocated and "al" must have been checked for room.
set_fnum | 1: set buffer number; 2: re-use curbuf |
Clear an argument list: free all file names and reset it to zero entries.
void alist_expand | ( | int * | fnum_list, |
int | fnum_len | ||
) |
Expand the file names in the global argument list. If "fnum_list" is not NULL, use "fnum_list[fnum_len]" as a list of buffer numbers to be re-used.
void alist_set | ( | alist_T * | al, |
int | count, | ||
char ** | files, | ||
int | use_curbuf, | ||
int * | fnum_list, | ||
int | fnum_len | ||
) |
Set the argument list for the current window. Takes over the allocated files[] and the allocated fnames in it.
Remove a reference from an argument list. Ignored when the argument list is the global one. If the argument list is no longer used by any window, free it.
Change directory function used by :cd/:tcd/:lcd Ex commands and the chdir() function.
new_dir | The directory to change to. |
scope | Scope of the function call (global, tab or window). |
Check if *p is a separator between Ex commands, skipping over white space.
int checkforcmd | ( | char ** | pp, |
char * | cmd, | ||
int | len | ||
) |
Check for an Ex command with optional tail. If there is a match advance "pp" to the argument and return TRUE.
pp | start of command |
cmd | name of command |
len | required length |
bool cmd_can_preview | ( | char * | cmd | ) |
Checks if cmd
is "previewable" (i.e. supported by 'inccommand').
[in] | cmd | Commandline to check. May start with a range or modifier. |
cmd
is previewable int cmd_exists | ( | const char *const | name | ) |
int cmdcomplete_str_to_type | ( | const char * | complete_str | ) |
Dictionary commands_array | ( | buf_T * | buf | ) |
Gets a map of maps describing user-commands defined for buffer buf
or defined globally if buf
is NULL.
buf | Buffer to inspect, or NULL to get global commands. |
void dialog_msg | ( | char * | buff, |
char * | format, | ||
char * | fname | ||
) |
Make a dialog message in "buff[DIALOG_MSG_SIZE]". "format" must contain "%s".
int do_cmdline | ( | char * | cmdline, |
LineGetter | fgetline, | ||
void * | cookie, | ||
int | flags | ||
) |
do_cmdline(): execute one Ex command line
This function can be called recursively!
flags: DOCMD_VERBOSE - The command will be included in the error message. DOCMD_NOWAIT - Don't call wait_return() and friends. DOCMD_REPEAT - Repeat execution until fgetline() returns NULL. DOCMD_KEYTYPED - Don't reset KeyTyped. DOCMD_EXCRESET - Reset the exception environment (used for debugging). DOCMD_KEEPLINE - Store first typed line (for repeating with "."). DOCMD_PREVIEW - During 'inccommand' preview.
cookie | argument for fgetline() |
int do_cmdline_cmd | ( | const char * | cmd | ) |
Execute a simple command line. Used for translated commands like "*".
":edit <file>" command and alike.
old_curwin | curwin before doing a split or NULL |
void do_sleep | ( | long | msec | ) |
Sleep for "msec" milliseconds, but keep checking for a CTRL-C every second.
int ends_excmd | ( | int | c | ) |
char_u* eval_vars | ( | char_u * | src, |
char_u * | srcstart, | ||
size_t * | usedlen, | ||
linenr_T * | lnump, | ||
char ** | errormsg, | ||
int * | escaped | ||
) |
Evaluate cmdline variables.
change '' to curbuf->b_ffname '#' to curwin->w_alt_fnum '<cword>' to word under the cursor '<cWORD>' to WORD under the cursor '<cexpr>' to C-expression under the cursor '<cfile>' to path name under the cursor '<sfile>' to sourced file name '<slnum>' to sourced file line number '<afile>' to file name for autocommand '<abuf>' to buffer number for autocommand '<amatch>' to matching name for autocommand
When an error is detected, "errormsg" is set to a non-NULL pointer (may be "" for error without a message) and NULL is returned.
src | pointer into commandline |
srcstart | beginning of valid memory for src |
usedlen | characters after src that are used |
lnump | line number for :e command, or NULL |
errormsg | pointer to error message |
escaped | return value has escaped white space (can be NULL) |
":all" and ":sall". Also used for ":tab drop file ..." after setting the argument list.
":comclear" Clear all user commands, global and for current buffer.
char* ex_errmsg | ( | const char *const | msg, |
const char *const | arg | ||
) |
:sview [+command] file split window with new file, read-only :split [[+command] file] split window with current or new file :vsplit [[+command] file] split window vertically with current or new file :new [[+command] file] split window with no or new file :vnew [[+command] file] split vertically window with no or new file :sfind [+command] file split window with file in 'path'
:tabedit open new Tab page with empty window :tabedit [+command] file open new Tab page and edit "file" :tabnew [[+command] file] just like :tabedit :tabfind [+command] file open new Tab page and find "file"
Close window "win" and take care of handling closing the last window for a modified buffer.
tp | NULL or the tab page "win" is in |
Execute normal_cmd() until there is no typeahead left.
was_typed | whether or not something was typed |
Execute normal mode command "cmd". "remap" can be REMAP_NONE or REMAP_YES.
void execute_cmd | ( | exarg_T * | eap, |
CmdParseInfo * | cmdinfo | ||
) |
Execute an Ex command using parsed command line information. Does not do any validation of the Ex command arguments.
eap | Ex-command arguments |
cmdinfo | Command parse information |
Expand file name in Ex command argument. When an error is detected, "errormsgp" is set to a non-NULL pointer.
char* expand_sfile | ( | char * | arg | ) |
Expand the <sfile> string in "arg".
Enable filetype detection if the user did not explicitly disable it.
Source ftplugin.vim and indent.vim to create the necessary FileType autocommands. We do this separately from filetype.vim so that these autocommands will always fire first (and thus can be overridden) while still allowing general filetype detection to be disabled in the user's init file.
ssize_t find_cmdline_var | ( | const char_u * | src, |
size_t * | usedlen | ||
) |
Check "str" for starting with a special cmdline variable. If found return one of the SPEC_ values and set "*usedlen" to the length of the variable. Otherwise return -1 and "*usedlen" is unchanged.
char* find_ex_command | ( | exarg_T * | eap, |
int * | full | ||
) |
Find an Ex command by its name, either built-in or user. Start of the name can be found at eap->cmd. Sets eap->cmdidx and returns a pointer to char after the command name. "full" is set to TRUE if the whole command name matched.
char* get_behave_arg | ( | expand_T * | xp, |
int | idx | ||
) |
Function given to ExpandGeneric() to obtain the possible arguments of the ":behave {mswin,xterm}" command.
uint32_t get_cmd_argt | ( | cmdidx_T | cmdidx | ) |
Get argt of command with id.
Get default range number for command based on its address type.
char* get_command_name | ( | expand_T * | xp, |
int | idx | ||
) |
Function given to ExpandGeneric() to obtain the list of command names.
char* get_mapclear_arg | ( | expand_T *xp | FUNC_ATTR_UNUSED, |
int | idx | ||
) |
char* get_messages_arg | ( | expand_T *xp | FUNC_ATTR_UNUSED, |
int | idx | ||
) |
Function given to ExpandGeneric() to obtain the possible arguments of the ":messages {clear}" command.
char* get_user_cmd_addr_type | ( | expand_T * | xp, |
int | idx | ||
) |
Function given to ExpandGeneric() to obtain the list of user address type names.
char* get_user_cmd_complete | ( | expand_T * | xp, |
int | idx | ||
) |
Function given to ExpandGeneric() to obtain the list of values for -complete.
char* get_user_cmd_flags | ( | expand_T * | xp, |
int | idx | ||
) |
Function given to ExpandGeneric() to obtain the list of user command attributes.
char* get_user_cmd_nargs | ( | expand_T * | xp, |
int | idx | ||
) |
Function given to ExpandGeneric() to obtain the list of values for -nargs.
char* get_user_commands | ( | expand_T *xp | FUNC_ATTR_UNUSED, |
int | idx | ||
) |
Function given to ExpandGeneric() to obtain the list of user command names.
void* getline_cookie | ( | LineGetter | fgetline, |
void * | cookie | ||
) |
If "fgetline" is get_loop_line(), return the cookie used by the original getline function. Otherwise return "cookie".
cookie | argument for fgetline() |
int getline_equal | ( | LineGetter | fgetline, |
void * | cookie, | ||
LineGetter | func | ||
) |
If "fgetline" is get_loop_line(), return TRUE if the getline it uses equals "func". * Otherwise return TRUE when "fgetline" equals "func".
cookie | argument for fgetline() |
if | ( | cmp ! | = 0 | ) |
if | ( | flags & | UC_BUFFER | ) |
char* invalid_range | ( | exarg_T * | eap | ) |
Check range in Ex command for validity.
bool is_cmd_ni | ( | cmdidx_T | cmdidx | ) |
Check if command is not implemented.
bool is_loclist_cmd | ( | int | cmdidx | ) |
int modifier_len | ( | char * | cmd | ) |
NLUA_CLEAR_REF | ( | compl_luaref | ) |
NLUA_CLEAR_REF | ( | luaref | ) |
Call this function if we thought we were going to exit, but we won't (because of an error). May need to restore the terminal mode.
FILE* open_exfile | ( | char_u * | fname, |
int | forceit, | ||
char * | mode | ||
) |
Open a file for writing for an Ex command, with some checks.
mode | "w" for create new file or "a" for append |
int parse_addr_type_arg | ( | char * | value, |
int | vallen, | ||
cmd_addr_T * | addr_type_arg | ||
) |
Parse address type argument.
Parse the address range, if any, in "eap". May set the last search pattern, unless "silent" is true.
bool parse_cmdline | ( | char * | cmdline, |
exarg_T * | eap, | ||
CmdParseInfo * | cmdinfo, | ||
char ** | errormsg | ||
) |
Parse command line and return information about the first command.
cmdline | Command line string | |
[out] | eap | Ex command arguments |
[out] | cmdinfo | Command parse information |
[out] | errormsg | Error message, if any |
Parse and skip over command modifiers:
skip_only | if true, the global variables are not changed, except for "cmdmod". | |
[out] | errormsg | potential error message. |
int parse_compl_arg | ( | const char * | value, |
int | vallen, | ||
int * | complp, | ||
uint32_t * | argt, | ||
char ** | compl_arg | ||
) |
Parse a completion argument "value[vallen]". The detected completion goes in "*complp", argument type in "*argt". When there is an argument, for function and user defined completion, it's copied to allocated memory and stored in "*compl_arg".
char* replace_makeprg | ( | exarg_T * | eap, |
char * | p, | ||
char ** | cmdlinep | ||
) |
For the ":make" and ":grep" commands insert the 'makeprg'/'grepprg' option in the command line, so that things like % get expanded.
replace_termcodes | ( | rep | , |
STRLEN(rep) | , | ||
& | rep_buf, | ||
0 | , | ||
NULL | , | ||
CPO_TO_CPO_FLAGS | |||
) |
void restore_current_state | ( | save_state_T * | sst | ) |
bool save_current_state | ( | save_state_T * | sst | ) |
Save the current State and go to Normal mode.
Check for '|' to separate commands and '"' to start comments.
Set the addr type for command
p | pointer to character after command name in cmdline |
Set default command range for -range=% based on the addr type of the command.
const char* set_one_cmd_context | ( | expand_T * | xp, |
const char * | buff | ||
) |
This is all pretty much copied from do_one_cmd(), with all the extra stuff we don't need/want deleted. Maybe this could be done better if we didn't repeat all this stuff. The only problem is that they may not stay perfectly compatible with each other, but then the command line syntax probably won't change that much – webb.
buff | buffer for command string |
char* skip_range | ( | const char * | cmd, |
int * | ctx | ||
) |
Skip a range specifier of the form: addr [,addr] [;addr] ..
Backslashed delimiters after / or ? will be skipped, and commands will not be expanded between /'s and ?'s or after "'".
Also skip white space and ":" characters.
ctx | pointer to xp_context or NULL |
void tabpage_close | ( | int | forceit | ) |
Close the current tab page.
Close tab page "tp", which is not the current tab page. Note that autocommands may make "tp" invalid. Also takes care of the tab pages line disappearing when closing the last-but-one tab page.
int uc_add_command | ( | char * | name, |
size_t | name_len, | ||
char * | rep, | ||
uint32_t | argt, | ||
long | def, | ||
int | flags, | ||
int | compl, | ||
char * | compl_arg, | ||
LuaRef | compl_luaref, | ||
cmd_addr_T | addr_type, | ||
LuaRef | luaref, | ||
bool | force | ||
) |
size_t uc_mods | ( | char * | buf | ) |
bool uc_split_args_iter | ( | const char * | arg, |
size_t | arglen, | ||
size_t * | end, | ||
char * | buf, | ||
size_t * | len | ||
) |
Split a string by unescaped whitespace (space & tab), used for f-args on Lua commands callback. Similar to uc_split_args(), but does not allocate, add quotes, add commas and is an iterator.
[in] | arg | String to split |
[in] | arglen | Length of {arg} |
[in,out] | end | Index of last character of previous iteration |
[out] | buf | Buffer to copy string into |
[out] | len | Length of string in {buf} |
char* uc_validate_name | ( | char * | name | ) |
Check for a valid user command name
If the given {name} is valid, then a pointer to the end of the valid name is returned. Otherwise, returns NULL.
void verify_command | ( | char * | cmd | ) |
int vim_mkdir_emsg | ( | const char *const | name, |
const int | prot | ||
) |
xfree | ( | compl_arg | ) |
fail __pad0__ |
nlua_set_sctx& cmd |
int cmp = 1 |
return FAIL |
garray_T* gap |
char* name |
return OK |
char* rep_buf = NULL |
cmd uc_script_ctx sc_lnum = sourcing_lnum |
char* shortname |
cmd uc_addr_type = addr_type |
cmd uc_argt = argt |
cmd uc_compl = compl |
cmd uc_compl_luaref = compl_luaref |
cmd uc_def = def |
cmd uc_luaref = luaref |
cmd uc_script_ctx = current_sctx |