diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2015-07-14 13:53:45 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-07-15 22:03:35 -0400 |
commit | 1e031650742310920e7d8ed10c02ceccb54e0a89 (patch) | |
tree | 6e1f434b4ff3e67e3531b1b21661733b23ce7115 /src | |
parent | 59784b91dbf97388281c1eb6989e2e770eb7ecac (diff) | |
download | rneovim-1e031650742310920e7d8ed10c02ceccb54e0a89.tar.gz rneovim-1e031650742310920e7d8ed10c02ceccb54e0a89.tar.bz2 rneovim-1e031650742310920e7d8ed10c02ceccb54e0a89.zip |
Remove :tearoff #3007
This also removes the 't' flag from 'guioptions'.
Side effect: :term[inal] -> :te[rminal]
Closes #3003.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_cmds.lua | 6 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 3 | ||||
-rw-r--r-- | src/nvim/keymap.h | 6 | ||||
-rw-r--r-- | src/nvim/menu.c | 38 | ||||
-rw-r--r-- | src/nvim/option_defs.h | 1 |
5 files changed, 4 insertions, 50 deletions
diff --git a/src/nvim/ex_cmds.lua b/src/nvim/ex_cmds.lua index 011b3ce611..41c596c5a8 100644 --- a/src/nvim/ex_cmds.lua +++ b/src/nvim/ex_cmds.lua @@ -2678,12 +2678,6 @@ return { func='ex_ni', }, { - command='tearoff', - flags=bit.bor(NEEDARG, EXTRA, TRLBAR, NOTRLCOM, CMDWIN), - addr_type=ADDR_LINES, - func='ex_tearoff', - }, - { command='terminal', flags=bit.bor(BANG, FILES, CMDWIN), addr_type=ADDR_LINES, diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 35b62cdd47..e53b2e47c5 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -144,7 +144,6 @@ struct dbg_stuff { #endif # define ex_gui ex_nogui -# define ex_tearoff ex_ni # define ex_popup ex_ni # define ex_simalt ex_ni # define gui_mch_find_dialog ex_ni @@ -3276,7 +3275,7 @@ set_one_cmd_context ( case CMD_imenu: case CMD_inoremenu: case CMD_iunmenu: case CMD_cmenu: case CMD_cnoremenu: case CMD_cunmenu: case CMD_tmenu: case CMD_tunmenu: - case CMD_popup: case CMD_tearoff: case CMD_emenu: + case CMD_popup: case CMD_emenu: return set_context_in_menu_cmd(xp, cmd, arg, forceit); case CMD_colorscheme: diff --git a/src/nvim/keymap.h b/src/nvim/keymap.h index 022d27fda1..38b96b1b8c 100644 --- a/src/nvim/keymap.h +++ b/src/nvim/keymap.h @@ -83,11 +83,6 @@ #define KS_SELECT 245 #define K_SELECT_STRING (char_u *)"\200\365X" -/* - * Used for tearing off a menu. - */ -#define KS_TEAROFF 244 - /* Used a termcap entry that produces a normal character. */ #define KS_KEY 242 @@ -396,7 +391,6 @@ enum key_extra { #define K_HOR_SCROLLBAR TERMCAP2KEY(KS_HOR_SCROLLBAR, KE_FILLER) #define K_SELECT TERMCAP2KEY(KS_SELECT, KE_FILLER) -#define K_TEAROFF TERMCAP2KEY(KS_TEAROFF, KE_FILLER) #define K_TABLINE TERMCAP2KEY(KS_TABLINE, KE_FILLER) #define K_TABMENU TERMCAP2KEY(KS_TABMENU, KE_FILLER) diff --git a/src/nvim/menu.c b/src/nvim/menu.c index 0db0ddffb8..06351581ea 100644 --- a/src/nvim/menu.c +++ b/src/nvim/menu.c @@ -417,9 +417,8 @@ add_menu_path ( /* free any old menu */ free_menu_string(menu, i); - /* For "amenu", may insert an extra character. - * Don't do this if adding a tearbar (addtearoff == FALSE). - * Don't do this for "<Nop>". */ + // For "amenu", may insert an extra character. + // Don't do this for "<Nop>". c = 0; d = 0; if (amenu && call_data != NULL && *call_data != NUL @@ -571,16 +570,6 @@ remove_menu ( return FAIL; } if ((menu->modes & modes) != 0x0) { -#if defined(FEAT_GUI_W32) & defined(FEAT_TEAROFF) - /* - * If we are removing all entries for this menu,MENU_ALL_MODES, - * Then kill any tearoff before we start - */ - if (*p == NUL && modes == MENU_ALL_MODES) { - if (IsWindow(menu->tearoff_handle)) - DestroyWindow(menu->tearoff_handle); - } -#endif if (remove_menu(&menu->children, p, modes, silent) == FAIL) return FAIL; } else if (*name != NUL) { @@ -619,11 +608,6 @@ remove_menu ( /* Recalculate modes for menu based on the new updated children */ menu->modes &= ~modes; -#if defined(FEAT_GUI_W32) & defined(FEAT_TEAROFF) - if ((s_tearoffs) && (menu->children != NULL)) /* there's a tear bar.. */ - child = menu->children->next; /* don't count tearoff bar */ - else -#endif child = menu->children; for (; child != NULL; child = child->next) menu->modes |= child->modes; @@ -638,10 +622,6 @@ remove_menu ( } if ((menu->modes & MENU_ALL_MODES) == 0) { /* The menu item is no longer valid in ANY mode, so delete it */ -#if defined(FEAT_GUI_W32) & defined(FEAT_TEAROFF) - if (s_tearoffs && menu->children != NULL) /* there's a tear bar.. */ - free_menu(&menu->children); -#endif *menup = menu; free_menu(menup); } @@ -862,7 +842,7 @@ char_u *set_context_in_menu_cmd(expand_T *xp, char_u *cmd, char_u *arg, int forc after_dot = p + 1; } - /* ":tearoff" and ":popup" only use menus, not entries */ + // ":popup" only uses menues, not entries expand_menus = !((*cmd == 't' && cmd[1] == 'e') || *cmd == 'p'); expand_emenu = (*cmd == 'e'); if (expand_menus && ascii_iswhite(*p)) @@ -938,7 +918,6 @@ char_u *get_menu_name(expand_T *xp, int idx) /* Skip PopUp[nvoci]. */ while (menu != NULL && (menu_is_hidden(menu->dname) || menu_is_separator(menu->dname) - || menu_is_tearoff(menu->dname) || menu->children == NULL)) menu = menu->next; @@ -986,7 +965,6 @@ char_u *get_menu_names(expand_T *xp, int idx) while (menu != NULL && ( menu_is_hidden(menu->dname) || (expand_emenu && menu_is_separator(menu->dname)) - || menu_is_tearoff(menu->dname) || menu->dname[STRLEN(menu->dname) - 1] == '.' )) menu = menu->next; @@ -1245,16 +1223,6 @@ static int menu_is_hidden(char_u *name) } /* - * Return TRUE if the menu is the tearoff menu. - */ -static int menu_is_tearoff(char_u *name) -{ - return FALSE; -} - - - -/* * Given a menu descriptor, e.g. "File.New", find it in the menu hierarchy and * execute it. */ diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h index b13ead9cbb..a33ecd099b 100644 --- a/src/nvim/option_defs.h +++ b/src/nvim/option_defs.h @@ -200,7 +200,6 @@ #define GO_ASELPLUS 'P' /* autoselectPlus */ #define GO_RIGHT 'r' /* use right scrollbar */ #define GO_VRIGHT 'R' /* right scrollbar with vert split */ -#define GO_TEAROFF 't' /* add tear-off menu items */ #define GO_TOOLBAR 'T' /* add toolbar */ #define GO_FOOTER 'F' /* add footer */ #define GO_VERTICAL 'v' /* arrange dialog buttons vertically */ |