support for :perl, :perlfile, :perldo and perleval()

This commit is contained in:
Jacques Germishuys
2020-08-29 22:12:10 +01:00
parent c6648fe882
commit 9bef25314e
10 changed files with 205 additions and 6 deletions

View File

@@ -256,6 +256,7 @@ return {
py3eval={args=1},
pyeval={args=1},
pyxeval={args=1},
perleval={args=1},
range={args={1, 3}},
readdir={args={1, 2}},
readfile={args={1, 3}},

View File

@@ -6374,6 +6374,14 @@ static void f_pyxeval(typval_T *argvars, typval_T *rettv, FunPtr fptr)
}
}
///
/// "perleval()" function
///
static void f_perleval(typval_T *argvars, typval_T *rettv, FunPtr fptr)
{
script_host_eval("perl", argvars, rettv);
}
/*
* "range()" function
*/

View File

@@ -1927,13 +1927,19 @@ return {
command='perl',
flags=bit.bor(RANGE, EXTRA, DFLALL, NEEDARG, SBOXOK, CMDWIN, RESTRICT),
addr_type=ADDR_LINES,
func='ex_script_ni',
func='ex_perl',
},
{
command='perldo',
flags=bit.bor(RANGE, EXTRA, DFLALL, NEEDARG, CMDWIN, RESTRICT),
addr_type=ADDR_LINES,
func='ex_ni',
func='ex_perldo',
},
{
command='perlfile',
flags=bit.bor(RANGE, FILE1, NEEDARG, CMDWIN, RESTRICT),
addr_type=ADDR_LINES,
func='ex_perlfile',
},
{
command='pedit',

View File

@@ -935,6 +935,21 @@ void ex_pydo3(exarg_T *eap)
script_host_do_range("python3", eap);
}
void ex_perl(exarg_T *eap)
{
script_host_execute("perl", eap);
}
void ex_perlfile(exarg_T *eap)
{
script_host_execute_file("perl", eap);
}
void ex_perldo(exarg_T *eap)
{
script_host_do_range("perl", eap);
}
// Command line expansion for :profile.
static enum {
PEXP_SUBCMD, ///< expand :profile sub-commands