aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/menu.c')
-rw-r--r--src/nvim/menu.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/nvim/menu.c b/src/nvim/menu.c
index 192bed76ef..c1ce2eefe3 100644
--- a/src/nvim/menu.c
+++ b/src/nvim/menu.c
@@ -18,7 +18,7 @@
#include "nvim/ex_docmd.h"
#include "nvim/garray.h"
#include "nvim/getchar.h"
-#include "nvim/keymap.h"
+#include "nvim/keycodes.h"
#include "nvim/memory.h"
#include "nvim/menu.h"
#include "nvim/message.h"
@@ -1034,7 +1034,7 @@ char *set_context_in_menu_cmd(expand_T *xp, const char *cmd, char *arg, bool for
* Function given to ExpandGeneric() to obtain the list of (sub)menus (not
* entries).
*/
-char_u *get_menu_name(expand_T *xp, int idx)
+char *get_menu_name(expand_T *xp, int idx)
{
static vimmenu_T *menu = NULL;
char *str;
@@ -1076,14 +1076,14 @@ char_u *get_menu_name(expand_T *xp, int idx)
should_advance = !should_advance;
- return (char_u *)str;
+ return str;
}
/*
* Function given to ExpandGeneric() to obtain the list of menus and menu
* entries.
*/
-char_u *get_menu_names(expand_T *xp, int idx)
+char *get_menu_names(expand_T *xp, int idx)
{
static vimmenu_T *menu = NULL;
#define TBUFFER_LEN 256
@@ -1143,7 +1143,7 @@ char_u *get_menu_names(expand_T *xp, int idx)
should_advance = !should_advance;
- return (char_u *)str;
+ return str;
}
@@ -1301,7 +1301,7 @@ static char *menu_text(const char *str, int *mnemonic, char **actext)
char *text;
// Locate accelerator text, after the first TAB
- p = (char *)vim_strchr((char_u *)str, TAB);
+ p = vim_strchr(str, TAB);
if (p != NULL) {
if (actext != NULL) {
*actext = xstrdup(p + 1);
@@ -1314,7 +1314,7 @@ static char *menu_text(const char *str, int *mnemonic, char **actext)
// Find mnemonic characters "&a" and reduce "&&" to "&".
for (p = text; p != NULL;) {
- p = (char *)vim_strchr((char_u *)p, '&');
+ p = vim_strchr(p, '&');
if (p != NULL) {
if (p[1] == NUL) { // trailing "&"
break;
@@ -1382,16 +1382,16 @@ static void execute_menu(const exarg_T *eap, vimmenu_T *menu)
char *mode;
// Use the Insert mode entry when returning to Insert mode.
- if (((State & INSERT) || restart_edit) && !current_sctx.sc_sid) {
+ if (((State & MODE_INSERT) || restart_edit) && !current_sctx.sc_sid) {
mode = "Insert";
idx = MENU_INDEX_INSERT;
- } else if (State & CMDLINE) {
+ } else if (State & MODE_CMDLINE) {
mode = "Command";
idx = MENU_INDEX_CMDLINE;
- } else if (get_real_state() & VISUAL) {
- /* Detect real visual mode -- if we are really in visual mode we
- * don't need to do any guesswork to figure out what the selection
- * is. Just execute the visual binding for the menu. */
+ } else if (get_real_state() & MODE_VISUAL) {
+ // Detect real visual mode -- if we are really in visual mode we
+ // don't need to do any guesswork to figure out what the selection
+ // is. Just execute the visual binding for the menu.
mode = "Visual";
idx = MENU_INDEX_VISUAL;
} else if (eap != NULL && eap->addr_count) {