Data Structures | Macros | Functions
menu.c File Reference
#include <assert.h>
#include <inttypes.h>
#include <string.h>
#include "nvim/ascii.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
#include "nvim/ex_docmd.h"
#include "nvim/garray.h"
#include "nvim/getchar.h"
#include "nvim/keycodes.h"
#include "nvim/memory.h"
#include "nvim/menu.h"
#include "nvim/message.h"
#include "nvim/screen.h"
#include "nvim/state.h"
#include "nvim/strings.h"
#include "nvim/ui.h"
#include "nvim/vim.h"
#include "nvim/window.h"

Data Structures

struct  menutrans_T
 

Macros

#define MENUDEPTH   10
 
#define TBUFFER_LEN   256
 
#define FREE_MENUTRANS(mt)
 

Functions

void ex_menu (exarg_T *eap)
 
bool menu_get (char *const path_name, int modes, list_T *list)
 
char * set_context_in_menu_cmd (expand_T *xp, const char *cmd, char *arg, bool forceit) FUNC_ATTR_NONNULL_ALL
 
char * get_menu_name (expand_T *xp, int idx)
 
char * get_menu_names (expand_T *xp, int idx)
 
char * menu_name_skip (char *const name)
 
int get_menu_cmd_modes (const char *cmd, bool forceit, int *noremap, int *unmenu)
 
bool menu_is_menubar (const char *const name) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
 
bool menu_is_popup (const char *const name) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
 
bool menu_is_toolbar (const char *const name) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
 
int menu_is_separator (char *name)
 
void ex_emenu (exarg_T *eap)
 
void ex_menutranslate (exarg_T *eap)
 

Macro Definition Documentation

◆ FREE_MENUTRANS

#define FREE_MENUTRANS (   mt)
Value:
menutrans_T *_mt = (mt); \
xfree(_mt->from); \
xfree(_mt->from_noamp); \
xfree(_mt->to)

◆ MENUDEPTH

#define MENUDEPTH   10

◆ TBUFFER_LEN

#define TBUFFER_LEN   256

Function Documentation

◆ ex_emenu()

void ex_emenu ( exarg_T eap)

◆ ex_menu()

void ex_menu ( exarg_T eap)

Do the :menu command and relatives.

Parameters
eapEx command arguments

◆ ex_menutranslate()

void ex_menutranslate ( exarg_T eap)

◆ get_menu_cmd_modes()

int get_menu_cmd_modes ( const char *  cmd,
bool  forceit,
int *  noremap,
int *  unmenu 
)

Returns the MENU_MODES specified by menu command cmd. (eg :menu! returns MENU_CMDLINE_MODE | MENU_INSERT_MODE)

Parameters
[in]cmdstring like "nmenu", "vmenu", etc.
[in]forceitbang (!) was given after the command
[out]noremapIf not NULL, the flag it points to is set according to whether the command is a "nore" command.
[out]unmenuIf not NULL, the flag it points to is set according to whether the command is an "unmenu" command.

◆ get_menu_name()

char* get_menu_name ( expand_T xp,
int  idx 
)

◆ get_menu_names()

char* get_menu_names ( expand_T xp,
int  idx 
)

◆ menu_get()

bool menu_get ( char *const  path_name,
int  modes,
list_T list 
)

Export menus matching path path_name

Parameters
path_name
modessupported modes, see MENU_MODES
[in,out]listmust be allocated
Returns
false if could not find path_name

◆ menu_is_menubar()

bool menu_is_menubar ( const char *const  name)

◆ menu_is_popup()

bool menu_is_popup ( const char *const  name)

◆ menu_is_separator()

int menu_is_separator ( char *  name)

◆ menu_is_toolbar()

bool menu_is_toolbar ( const char *const  name)

◆ menu_name_skip()

char* menu_name_skip ( char *const  name)

Skip over this element of the menu path and return the start of the next element. Any \ and ^Vs are removed from the current element.

Parameters
namemay be modified.
Returns
start of the next element

◆ set_context_in_menu_cmd()

char* set_context_in_menu_cmd ( expand_T xp,
const char *  cmd,
char *  arg,
bool  forceit 
)
menutrans_T::from
char * from
Definition: menu.c:1514
menutrans_T::from_noamp
char * from_noamp
Definition: menu.c:1515
menutrans_T
Definition: menu.c:1513
menutrans_T::to
char * to
Definition: menu.c:1516