mirror of
https://github.com/neovim/neovim.git
synced 2025-09-19 17:58:18 +00:00
ex_cmds.lua: Use ex_ni directly
As can be seen in [1], the ifdefs are leftovers from Vim, where tons of features are optional. This is not the case in Nvim, so the macros are of little use. Besides, ex_ni is already used in a bunch of places, just not consistently. The ex_language macro was left untouched as the inclusion of ``:language'' actually is determined at compile time, unlike the other commands which _always_ print "this command is not available in this version". [1]: https://github.com/vim/vim/blob/master/src/ex_docmd.c#L18-L497 Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
This commit is contained in:
@@ -989,13 +989,13 @@ return {
|
|||||||
command='gui',
|
command='gui',
|
||||||
flags=bit.bor(BANG, FILES, EDITCMD, ARGOPT, TRLBAR, CMDWIN),
|
flags=bit.bor(BANG, FILES, EDITCMD, ARGOPT, TRLBAR, CMDWIN),
|
||||||
addr_type=ADDR_LINES,
|
addr_type=ADDR_LINES,
|
||||||
func='ex_gui',
|
func='ex_nogui',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
command='gvim',
|
command='gvim',
|
||||||
flags=bit.bor(BANG, FILES, EDITCMD, ARGOPT, TRLBAR, CMDWIN),
|
flags=bit.bor(BANG, FILES, EDITCMD, ARGOPT, TRLBAR, CMDWIN),
|
||||||
addr_type=ADDR_LINES,
|
addr_type=ADDR_LINES,
|
||||||
func='ex_gui',
|
func='ex_nogui',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
command='help',
|
command='help',
|
||||||
@@ -1013,7 +1013,7 @@ return {
|
|||||||
command='helpfind',
|
command='helpfind',
|
||||||
flags=bit.bor(EXTRA, NOTRLCOM),
|
flags=bit.bor(EXTRA, NOTRLCOM),
|
||||||
addr_type=ADDR_LINES,
|
addr_type=ADDR_LINES,
|
||||||
func='ex_helpfind',
|
func='ex_ni',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
command='helpgrep',
|
command='helpgrep',
|
||||||
@@ -1643,19 +1643,19 @@ return {
|
|||||||
command='nbkey',
|
command='nbkey',
|
||||||
flags=bit.bor(EXTRA, NOTADR, NEEDARG),
|
flags=bit.bor(EXTRA, NOTADR, NEEDARG),
|
||||||
addr_type=ADDR_LINES,
|
addr_type=ADDR_LINES,
|
||||||
func='ex_nbkey',
|
func='ex_ni',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
command='nbclose',
|
command='nbclose',
|
||||||
flags=bit.bor(TRLBAR, CMDWIN),
|
flags=bit.bor(TRLBAR, CMDWIN),
|
||||||
addr_type=ADDR_LINES,
|
addr_type=ADDR_LINES,
|
||||||
func='ex_nbclose',
|
func='ex_ni',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
command='nbstart',
|
command='nbstart',
|
||||||
flags=bit.bor(WORD1, TRLBAR, CMDWIN),
|
flags=bit.bor(WORD1, TRLBAR, CMDWIN),
|
||||||
addr_type=ADDR_LINES,
|
addr_type=ADDR_LINES,
|
||||||
func='ex_nbstart',
|
func='ex_ni',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
command='new',
|
command='new',
|
||||||
@@ -1859,7 +1859,7 @@ return {
|
|||||||
command='popup',
|
command='popup',
|
||||||
flags=bit.bor(NEEDARG, EXTRA, BANG, TRLBAR, NOTRLCOM, CMDWIN),
|
flags=bit.bor(NEEDARG, EXTRA, BANG, TRLBAR, NOTRLCOM, CMDWIN),
|
||||||
addr_type=ADDR_LINES,
|
addr_type=ADDR_LINES,
|
||||||
func='ex_popup',
|
func='ex_ni',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
command='ppop',
|
command='ppop',
|
||||||
@@ -1883,13 +1883,13 @@ return {
|
|||||||
command='promptfind',
|
command='promptfind',
|
||||||
flags=bit.bor(EXTRA, NOTRLCOM, CMDWIN),
|
flags=bit.bor(EXTRA, NOTRLCOM, CMDWIN),
|
||||||
addr_type=ADDR_LINES,
|
addr_type=ADDR_LINES,
|
||||||
func='gui_mch_find_dialog',
|
func='ex_ni',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
command='promptrepl',
|
command='promptrepl',
|
||||||
flags=bit.bor(EXTRA, NOTRLCOM, CMDWIN),
|
flags=bit.bor(EXTRA, NOTRLCOM, CMDWIN),
|
||||||
addr_type=ADDR_LINES,
|
addr_type=ADDR_LINES,
|
||||||
func='gui_mch_replace_dialog',
|
func='ex_ni',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
command='profile',
|
command='profile',
|
||||||
@@ -2303,7 +2303,7 @@ return {
|
|||||||
command='simalt',
|
command='simalt',
|
||||||
flags=bit.bor(NEEDARG, WORD1, TRLBAR, CMDWIN),
|
flags=bit.bor(NEEDARG, WORD1, TRLBAR, CMDWIN),
|
||||||
addr_type=ADDR_LINES,
|
addr_type=ADDR_LINES,
|
||||||
func='ex_simalt',
|
func='ex_ni',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
command='sign',
|
command='sign',
|
||||||
@@ -3029,7 +3029,7 @@ return {
|
|||||||
command='wsverb',
|
command='wsverb',
|
||||||
flags=bit.bor(EXTRA, NOTADR, NEEDARG),
|
flags=bit.bor(EXTRA, NOTADR, NEEDARG),
|
||||||
addr_type=ADDR_LINES,
|
addr_type=ADDR_LINES,
|
||||||
func='ex_wsverb',
|
func='ex_ni',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
command='wshada',
|
command='wshada',
|
||||||
|
@@ -80,6 +80,9 @@
|
|||||||
static int quitmore = 0;
|
static int quitmore = 0;
|
||||||
static int ex_pressedreturn = FALSE;
|
static int ex_pressedreturn = FALSE;
|
||||||
|
|
||||||
|
/* whether ":lcd" was produced for a session */
|
||||||
|
static int did_lcd;
|
||||||
|
|
||||||
typedef struct ucmd {
|
typedef struct ucmd {
|
||||||
char_u *uc_name; /* The command name */
|
char_u *uc_name; /* The command name */
|
||||||
uint32_t uc_argt; /* The argument type */
|
uint32_t uc_argt; /* The argument type */
|
||||||
@@ -144,23 +147,9 @@ struct dbg_stuff {
|
|||||||
# include "ex_docmd.c.generated.h"
|
# include "ex_docmd.c.generated.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# define ex_gui ex_nogui
|
|
||||||
# define ex_popup ex_ni
|
|
||||||
# define ex_simalt ex_ni
|
|
||||||
# define gui_mch_find_dialog ex_ni
|
|
||||||
# define gui_mch_replace_dialog ex_ni
|
|
||||||
# define ex_helpfind ex_ni
|
|
||||||
static int did_lcd; /* whether ":lcd" was produced for a session */
|
|
||||||
#ifndef HAVE_WORKING_LIBINTL
|
#ifndef HAVE_WORKING_LIBINTL
|
||||||
# define ex_language ex_ni
|
# define ex_language ex_ni
|
||||||
#endif
|
#endif
|
||||||
# define ex_wsverb ex_ni
|
|
||||||
# define ex_nbclose ex_ni
|
|
||||||
# define ex_nbkey ex_ni
|
|
||||||
# define ex_nbstart ex_ni
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Declare cmdnames[].
|
* Declare cmdnames[].
|
||||||
|
Reference in New Issue
Block a user