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/keymap.h"
#include "nvim/memory.h"
#include "nvim/menu.h"
#include "nvim/message.h"
#include "nvim/misc1.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_u *const path_name, int modes, list_T *list)
 
char_uset_context_in_menu_cmd (expand_T *xp, const char *cmd, char_u *arg, bool forceit) FUNC_ATTR_NONNULL_ALL
 
char_uget_menu_name (expand_T *xp, int idx)
 
char_uget_menu_names (expand_T *xp, int idx)
 
char_umenu_name_skip (char_u *const name)
 
int get_menu_cmd_modes (const char *cmd, bool forceit, int *noremap, int *unmenu)
 
bool menu_is_menubar (const char_u *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_u *const name) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
 
int menu_is_separator (char_u *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_u* get_menu_name ( expand_T xp,
int  idx 
)

◆ get_menu_names()

char_u* get_menu_names ( expand_T xp,
int  idx 
)

◆ menu_get()

bool menu_get ( char_u *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_u *const  name)

◆ menu_is_popup()

bool menu_is_popup ( const char *const  name)

◆ menu_is_separator()

int menu_is_separator ( char_u name)

◆ menu_is_toolbar()

bool menu_is_toolbar ( const char_u *const  name)

◆ menu_name_skip()

char_u* menu_name_skip ( char_u *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_u* set_context_in_menu_cmd ( expand_T xp,
const char *  cmd,
char_u arg,
bool  forceit 
)
menutrans_T::from
char_u * from
Definition: menu.c:1516
menutrans_T::to
char_u * to
Definition: menu.c:1518
menutrans_T
Definition: menu.c:1515
menutrans_T::from_noamp
char_u * from_noamp
Definition: menu.c:1517