mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
updated for version 7.0075
This commit is contained in:
@@ -1431,6 +1431,10 @@ EXTERN char_u e_intern2[] INIT(=N_("E685: Internal error: %s"));
|
||||
EXTERN char_u e_maxmempat[] INIT(=N_("E363: pattern uses more memory than 'maxmempattern'"));
|
||||
EXTERN char_u e_emptybuf[] INIT(=N_("E749: empty buffer"));
|
||||
|
||||
#ifdef FEAT_EX_EXTRA
|
||||
EXTERN char_u e_invalpat[] INIT(=N_("E682: Invalid search pattern or delimiter"));
|
||||
#endif
|
||||
|
||||
#ifdef MACOS_X_UNIX
|
||||
EXTERN short disallow_gui INIT(= FALSE);
|
||||
#endif
|
||||
|
20
src/ops.c
20
src/ops.c
@@ -783,6 +783,17 @@ get_expr_line()
|
||||
vim_free(expr_copy);
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the '=' register expression itself, without evaluating it.
|
||||
*/
|
||||
char_u *
|
||||
get_expr_line_src()
|
||||
{
|
||||
if (expr_line == NULL)
|
||||
return NULL;
|
||||
return vim_strsave(expr_line);
|
||||
}
|
||||
#endif /* FEAT_EVAL */
|
||||
|
||||
/*
|
||||
@@ -5588,9 +5599,10 @@ get_reg_type(regname, reglen)
|
||||
* Returns NULL for error.
|
||||
*/
|
||||
char_u *
|
||||
get_reg_contents(regname, allowexpr)
|
||||
get_reg_contents(regname, allowexpr, expr_src)
|
||||
int regname;
|
||||
int allowexpr; /* allow "=" register. */
|
||||
int allowexpr; /* allow "=" register */
|
||||
int expr_src; /* get expression for "=" register */
|
||||
{
|
||||
long i;
|
||||
char_u *retval;
|
||||
@@ -5601,7 +5613,11 @@ get_reg_contents(regname, allowexpr)
|
||||
if (regname == '=')
|
||||
{
|
||||
if (allowexpr)
|
||||
{
|
||||
if (expr_src)
|
||||
return get_expr_line_src();
|
||||
return get_expr_line();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@@ -266,6 +266,15 @@ STARTTEST
|
||||
:$put =string(reverse(sort(l)))
|
||||
:$put =string(sort(reverse(sort(l))))
|
||||
:"
|
||||
:" splitting a string to a List
|
||||
:$put =string(split(' aa bb '))
|
||||
:$put =string(split(' aa bb ', '\W\+', 0))
|
||||
:$put =string(split(' aa bb ', '\W\+', 1))
|
||||
:$put =string(split(' aa bb ', '\W', 1))
|
||||
:$put =string(split(':aa::bb:', ':', 0))
|
||||
:$put =string(split(':aa::bb:', ':', 1))
|
||||
:$put =string(split('aa,,bb, cc,', ',\s*', 1))
|
||||
:"
|
||||
:endfun
|
||||
:call Test(1, 2, [3, 4], {5: 6}) " This may take a while
|
||||
:"
|
||||
|
Reference in New Issue
Block a user