Benign repos Download

menu.c

Source contains an unconditional loopCalls a character-class helper
SHA-256bf2fbaa7c7b77ac68cecc06e21bc4c364059bcec90b7e208896e84cd71dc3269

Evidence

imports <assert.h> lines 1–48
1// Code for menus. Used for the GUI and 'wildmenu'.
2// GUI/Motif support by Robert Webb
3
4#include <assert.h>
5#include <stdbool.h>
6#include <stdint.h>
7#include <string.h>
8
9#include "nvim/ascii_defs.h"
10#include "nvim/autocmd.h"
11#include "nvim/autocmd_defs.h"
12#include "nvim/buffer_defs.h"
13#include "nvim/charset.h"
14#include "nvim/cmdexpand_defs.h"
15#include "nvim/cursor.h"
16#include "nvim/errors.h"
17#include "nvim/eval/typval.h"
18#include "nvim/eval/typval_defs.h"
19#include "nvim/eval/vars.h"
20#include "nvim/ex_cmds_defs.h"
21#include "nvim/ex_docmd.h"
22#include "nvim/garray.h"
23#include "nvim/garray_defs.h"
24#include "nvim/getchar.h"
25#include "nvim/getchar_defs.h"
26#include "nvim/gettext_defs.h"
27#include "nvim/globals.h"
28#include "nvim/highlight_defs.h"
29#include "nvim/keycodes.h"
30#include "nvim/macros_defs.h"
31#include "nvim/mbyte.h"
32#include "nvim/mbyte_defs.h"
33#include "nvim/memory.h"
34#include "nvim/menu.h"
35#include "nvim/menu_defs.h"
36#include "nvim/message.h"
37#include "nvim/option_vars.h"
38#include "nvim/popupmenu.h"
39#include "nvim/pos_defs.h"
40#include "nvim/state.h"
41#include "nvim/state_defs.h"
42#include "nvim/strings.h"
43#include "nvim/types_defs.h"
44#include "nvim/ui.h"
45#include "nvim/vim_defs.h"
46
47#define MENUDEPTH 10 // maximum depth of menus
48
C declares a character or byte buffer lines 56–62
56:29… [] = { "n", "v", "s", "o", "i", "c", "tl", "t" };
57
58static const char e_notsubmenu[] = N_("E327: Part of menu-item path is not sub-menu");
59static const char e_nomenu[] = N_("E329: No menu \"%s\"");
60
61// Return true if "name" is a window toolbar menu name.
62static bool menu_is_winbar(const char * …
English function-word token "this" lines 123–132
123:29… n=filename" argument
124 // TODO(nvim): Currently this is only parsed. Should expose it to UIs.
125 if (strncmp(arg, "icon=", 5) == 0) {
126 arg += 5;
⋯6 lines
Calls a character-class helper lines 139–146
139:12… n the priority table.
140 for (p = arg; *p; p++) {
141 if (!ascii_isdigit(*p) && *p != '.') {
142 break;
143 }
144 }
145 if (ascii_iswhite(*p)) {
146 for (i = 0; i < MENUDEPTH && !ascii_iswhite(*arg); i++ …
English function-word token "that" lines 190–193
190:2… // If there is only a menu name, display menus with that name.
191 if (*map_to == NUL && !unmenu && enable == kNone) {
192 show_menus(menu_path, modes);
193 …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.