|
Karsten Hopp |
962e0f |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
962e0f |
Subject: Patch 7.3.465
|
|
Karsten Hopp |
962e0f |
Fcc: outbox
|
|
Karsten Hopp |
962e0f |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
962e0f |
Mime-Version: 1.0
|
|
Karsten Hopp |
962e0f |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
962e0f |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
962e0f |
------------
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
Patch 7.3.465
|
|
Karsten Hopp |
962e0f |
Problem: Cannot get file name with newline from glob().
|
|
Karsten Hopp |
962e0f |
Solution: Add argument to glob() and expand() to indicate they must return a
|
|
Karsten Hopp |
962e0f |
list. (Christian Brabandt)
|
|
Karsten Hopp |
962e0f |
Files: runtime/doc/eval.txt, src/eval.c, src/ex_getln.c, src/vim.h
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
*** ../vim-7.3.464/runtime/doc/eval.txt 2011-12-14 15:32:44.000000000 +0100
|
|
Karsten Hopp |
962e0f |
--- runtime/doc/eval.txt 2012-03-07 18:49:26.000000000 +0100
|
|
Karsten Hopp |
962e0f |
***************
|
|
Karsten Hopp |
962e0f |
*** 1738,1744 ****
|
|
Karsten Hopp |
962e0f |
extend( {expr1}, {expr2} [, {expr3}])
|
|
Karsten Hopp |
962e0f |
List/Dict insert items of {expr2} into {expr1}
|
|
Karsten Hopp |
962e0f |
exp( {expr}) Float exponential of {expr}
|
|
Karsten Hopp |
962e0f |
! expand( {expr} [, {flag}]) String expand special keywords in {expr}
|
|
Karsten Hopp |
962e0f |
feedkeys( {string} [, {mode}]) Number add key sequence to typeahead buffer
|
|
Karsten Hopp |
962e0f |
filereadable( {file}) Number TRUE if {file} is a readable file
|
|
Karsten Hopp |
962e0f |
filewritable( {file}) Number TRUE if {file} is a writable file
|
|
Karsten Hopp |
962e0f |
--- 1746,1753 ----
|
|
Karsten Hopp |
962e0f |
extend( {expr1}, {expr2} [, {expr3}])
|
|
Karsten Hopp |
962e0f |
List/Dict insert items of {expr2} into {expr1}
|
|
Karsten Hopp |
962e0f |
exp( {expr}) Float exponential of {expr}
|
|
Karsten Hopp |
962e0f |
! expand( {expr} [, {nosuf} [, {list}]])
|
|
Karsten Hopp |
962e0f |
! any expand special keywords in {expr}
|
|
Karsten Hopp |
962e0f |
feedkeys( {string} [, {mode}]) Number add key sequence to typeahead buffer
|
|
Karsten Hopp |
962e0f |
filereadable( {file}) Number TRUE if {file} is a readable file
|
|
Karsten Hopp |
962e0f |
filewritable( {file}) Number TRUE if {file} is a writable file
|
|
Karsten Hopp |
962e0f |
***************
|
|
Karsten Hopp |
962e0f |
*** 1792,1798 ****
|
|
Karsten Hopp |
962e0f |
getwinposx() Number X coord in pixels of GUI Vim window
|
|
Karsten Hopp |
962e0f |
getwinposy() Number Y coord in pixels of GUI Vim window
|
|
Karsten Hopp |
962e0f |
getwinvar( {nr}, {varname}) any variable {varname} in window {nr}
|
|
Karsten Hopp |
962e0f |
! glob( {expr} [, {flag}]) String expand file wildcards in {expr}
|
|
Karsten Hopp |
962e0f |
globpath( {path}, {expr} [, {flag}])
|
|
Karsten Hopp |
962e0f |
String do glob({expr}) for all dirs in {path}
|
|
Karsten Hopp |
962e0f |
has( {feature}) Number TRUE if feature {feature} supported
|
|
Karsten Hopp |
962e0f |
--- 1801,1808 ----
|
|
Karsten Hopp |
962e0f |
getwinposx() Number X coord in pixels of GUI Vim window
|
|
Karsten Hopp |
962e0f |
getwinposy() Number Y coord in pixels of GUI Vim window
|
|
Karsten Hopp |
962e0f |
getwinvar( {nr}, {varname}) any variable {varname} in window {nr}
|
|
Karsten Hopp |
962e0f |
! glob( {expr} [, {nosuf} [, {list}]])
|
|
Karsten Hopp |
962e0f |
! any expand file wildcards in {expr}
|
|
Karsten Hopp |
962e0f |
globpath( {path}, {expr} [, {flag}])
|
|
Karsten Hopp |
962e0f |
String do glob({expr}) for all dirs in {path}
|
|
Karsten Hopp |
962e0f |
has( {feature}) Number TRUE if feature {feature} supported
|
|
Karsten Hopp |
962e0f |
***************
|
|
Karsten Hopp |
962e0f |
*** 2731,2743 ****
|
|
Karsten Hopp |
962e0f |
{only available when compiled with the |+float| feature}
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
! expand({expr} [, {flag}]) *expand()*
|
|
Karsten Hopp |
962e0f |
Expand wildcards and the following special keywords in {expr}.
|
|
Karsten Hopp |
962e0f |
! The result is a String.
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
! When there are several matches, they are separated by <NL>
|
|
Karsten Hopp |
962e0f |
! characters. [Note: in version 5.0 a space was used, which
|
|
Karsten Hopp |
962e0f |
! caused problems when a file name contains a space]
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
If the expansion fails, the result is an empty string. A name
|
|
Karsten Hopp |
962e0f |
for a non-existing file is not included.
|
|
Karsten Hopp |
962e0f |
--- 2744,2758 ----
|
|
Karsten Hopp |
962e0f |
{only available when compiled with the |+float| feature}
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
! expand({expr} [, {nosuf} [, {list}]]) *expand()*
|
|
Karsten Hopp |
962e0f |
Expand wildcards and the following special keywords in {expr}.
|
|
Karsten Hopp |
962e0f |
! 'wildignorecase' applies.
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
! If {list} is given and it is non-zero, a List will be returned.
|
|
Karsten Hopp |
962e0f |
! Otherwise the result is a String and when there are several
|
|
Karsten Hopp |
962e0f |
! matches, they are separated by <NL> characters. [Note: in
|
|
Karsten Hopp |
962e0f |
! version 5.0 a space was used, which caused problems when a
|
|
Karsten Hopp |
962e0f |
! file name contains a space]
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
If the expansion fails, the result is an empty string. A name
|
|
Karsten Hopp |
962e0f |
for a non-existing file is not included.
|
|
Karsten Hopp |
962e0f |
***************
|
|
Karsten Hopp |
962e0f |
*** 2754,2759 ****
|
|
Karsten Hopp |
962e0f |
--- 2769,2775 ----
|
|
Karsten Hopp |
962e0f |
<abuf> autocmd buffer number (as a String!)
|
|
Karsten Hopp |
962e0f |
<amatch> autocmd matched name
|
|
Karsten Hopp |
962e0f |
<sfile> sourced script file name
|
|
Karsten Hopp |
962e0f |
+ <slnum> sourced script file line number
|
|
Karsten Hopp |
962e0f |
<cword> word under the cursor
|
|
Karsten Hopp |
962e0f |
<cWORD> WORD under the cursor
|
|
Karsten Hopp |
962e0f |
<client> the {clientid} of the last received
|
|
Karsten Hopp |
962e0f |
***************
|
|
Karsten Hopp |
962e0f |
*** 2790,2799 ****
|
|
Karsten Hopp |
962e0f |
When {expr} does not start with '%', '#' or '<', it is
|
|
Karsten Hopp |
962e0f |
expanded like a file name is expanded on the command line.
|
|
Karsten Hopp |
962e0f |
'suffixes' and 'wildignore' are used, unless the optional
|
|
Karsten Hopp |
962e0f |
! {flag} argument is given and it is non-zero. Names for
|
|
Karsten Hopp |
962e0f |
! non-existing files are included. The "**" item can be used to
|
|
Karsten Hopp |
962e0f |
! search in a directory tree. For example, to find all "README"
|
|
Karsten Hopp |
962e0f |
! files in the current directory and below: >
|
|
Karsten Hopp |
962e0f |
:echo expand("**/README")
|
|
Karsten Hopp |
962e0f |
<
|
|
Karsten Hopp |
962e0f |
Expand() can also be used to expand variables and environment
|
|
Karsten Hopp |
962e0f |
--- 2806,2815 ----
|
|
Karsten Hopp |
962e0f |
When {expr} does not start with '%', '#' or '<', it is
|
|
Karsten Hopp |
962e0f |
expanded like a file name is expanded on the command line.
|
|
Karsten Hopp |
962e0f |
'suffixes' and 'wildignore' are used, unless the optional
|
|
Karsten Hopp |
962e0f |
! {nosuf} argument is given and it is non-zero.
|
|
Karsten Hopp |
962e0f |
! Names for non-existing files are included. The "**" item can
|
|
Karsten Hopp |
962e0f |
! be used to search in a directory tree. For example, to find
|
|
Karsten Hopp |
962e0f |
! all "README" files in the current directory and below: >
|
|
Karsten Hopp |
962e0f |
:echo expand("**/README")
|
|
Karsten Hopp |
962e0f |
<
|
|
Karsten Hopp |
962e0f |
Expand() can also be used to expand variables and environment
|
|
Karsten Hopp |
962e0f |
***************
|
|
Karsten Hopp |
962e0f |
*** 3437,3453 ****
|
|
Karsten Hopp |
962e0f |
:let list_is_on = getwinvar(2, '&list')
|
|
Karsten Hopp |
962e0f |
:echo "myvar = " . getwinvar(1, 'myvar')
|
|
Karsten Hopp |
962e0f |
<
|
|
Karsten Hopp |
962e0f |
! glob({expr} [, {flag}]) *glob()*
|
|
Karsten Hopp |
962e0f |
Expand the file wildcards in {expr}. See |wildcards| for the
|
|
Karsten Hopp |
962e0f |
use of special characters.
|
|
Karsten Hopp |
962e0f |
! The result is a String.
|
|
Karsten Hopp |
962e0f |
! When there are several matches, they are separated by <NL>
|
|
Karsten Hopp |
962e0f |
! characters.
|
|
Karsten Hopp |
962e0f |
! Unless the optional {flag} argument is given and is non-zero,
|
|
Karsten Hopp |
962e0f |
the 'suffixes' and 'wildignore' options apply: Names matching
|
|
Karsten Hopp |
962e0f |
one of the patterns in 'wildignore' will be skipped and
|
|
Karsten Hopp |
962e0f |
'suffixes' affect the ordering of matches.
|
|
Karsten Hopp |
962e0f |
! If the expansion fails, the result is an empty string.
|
|
Karsten Hopp |
962e0f |
A name for a non-existing file is not included.
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
For most systems backticks can be used to get files names from
|
|
Karsten Hopp |
962e0f |
--- 3456,3478 ----
|
|
Karsten Hopp |
962e0f |
:let list_is_on = getwinvar(2, '&list')
|
|
Karsten Hopp |
962e0f |
:echo "myvar = " . getwinvar(1, 'myvar')
|
|
Karsten Hopp |
962e0f |
<
|
|
Karsten Hopp |
962e0f |
! glob({expr} [, {nosuf} [, {list}]]) *glob()*
|
|
Karsten Hopp |
962e0f |
Expand the file wildcards in {expr}. See |wildcards| for the
|
|
Karsten Hopp |
962e0f |
use of special characters.
|
|
Karsten Hopp |
962e0f |
!
|
|
Karsten Hopp |
962e0f |
! Unless the optional {nosuf} argument is given and is non-zero,
|
|
Karsten Hopp |
962e0f |
the 'suffixes' and 'wildignore' options apply: Names matching
|
|
Karsten Hopp |
962e0f |
one of the patterns in 'wildignore' will be skipped and
|
|
Karsten Hopp |
962e0f |
'suffixes' affect the ordering of matches.
|
|
Karsten Hopp |
962e0f |
! 'wildignorecase' always applies.
|
|
Karsten Hopp |
962e0f |
!
|
|
Karsten Hopp |
962e0f |
! When {list} is present and it is non-zero the result is a List
|
|
Karsten Hopp |
962e0f |
! with all matching files. The advantage of using a List is,
|
|
Karsten Hopp |
962e0f |
! you also get filenames containing newlines correctly.
|
|
Karsten Hopp |
962e0f |
! Otherwise the result is a String and when there are several
|
|
Karsten Hopp |
962e0f |
! matches, they are separated by <NL> characters.
|
|
Karsten Hopp |
962e0f |
!
|
|
Karsten Hopp |
962e0f |
! If the expansion fails, the result is an empty String or List.
|
|
Karsten Hopp |
962e0f |
A name for a non-existing file is not included.
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
For most systems backticks can be used to get files names from
|
|
Karsten Hopp |
962e0f |
*** ../vim-7.3.464/src/eval.c 2012-02-11 20:44:01.000000000 +0100
|
|
Karsten Hopp |
962e0f |
--- src/eval.c 2012-03-07 19:08:36.000000000 +0100
|
|
Karsten Hopp |
962e0f |
***************
|
|
Karsten Hopp |
962e0f |
*** 7852,7858 ****
|
|
Karsten Hopp |
962e0f |
#ifdef FEAT_FLOAT
|
|
Karsten Hopp |
962e0f |
{"exp", 1, 1, f_exp},
|
|
Karsten Hopp |
962e0f |
#endif
|
|
Karsten Hopp |
962e0f |
! {"expand", 1, 2, f_expand},
|
|
Karsten Hopp |
962e0f |
{"extend", 2, 3, f_extend},
|
|
Karsten Hopp |
962e0f |
{"feedkeys", 1, 2, f_feedkeys},
|
|
Karsten Hopp |
962e0f |
{"file_readable", 1, 1, f_filereadable}, /* obsolete */
|
|
Karsten Hopp |
962e0f |
--- 7852,7858 ----
|
|
Karsten Hopp |
962e0f |
#ifdef FEAT_FLOAT
|
|
Karsten Hopp |
962e0f |
{"exp", 1, 1, f_exp},
|
|
Karsten Hopp |
962e0f |
#endif
|
|
Karsten Hopp |
962e0f |
! {"expand", 1, 3, f_expand},
|
|
Karsten Hopp |
962e0f |
{"extend", 2, 3, f_extend},
|
|
Karsten Hopp |
962e0f |
{"feedkeys", 1, 2, f_feedkeys},
|
|
Karsten Hopp |
962e0f |
{"file_readable", 1, 1, f_filereadable}, /* obsolete */
|
|
Karsten Hopp |
962e0f |
***************
|
|
Karsten Hopp |
962e0f |
*** 7903,7909 ****
|
|
Karsten Hopp |
962e0f |
{"getwinposx", 0, 0, f_getwinposx},
|
|
Karsten Hopp |
962e0f |
{"getwinposy", 0, 0, f_getwinposy},
|
|
Karsten Hopp |
962e0f |
{"getwinvar", 2, 2, f_getwinvar},
|
|
Karsten Hopp |
962e0f |
! {"glob", 1, 2, f_glob},
|
|
Karsten Hopp |
962e0f |
{"globpath", 2, 3, f_globpath},
|
|
Karsten Hopp |
962e0f |
{"has", 1, 1, f_has},
|
|
Karsten Hopp |
962e0f |
{"has_key", 2, 2, f_has_key},
|
|
Karsten Hopp |
962e0f |
--- 7903,7909 ----
|
|
Karsten Hopp |
962e0f |
{"getwinposx", 0, 0, f_getwinposx},
|
|
Karsten Hopp |
962e0f |
{"getwinposy", 0, 0, f_getwinposy},
|
|
Karsten Hopp |
962e0f |
{"getwinvar", 2, 2, f_getwinvar},
|
|
Karsten Hopp |
962e0f |
! {"glob", 1, 3, f_glob},
|
|
Karsten Hopp |
962e0f |
{"globpath", 2, 3, f_globpath},
|
|
Karsten Hopp |
962e0f |
{"has", 1, 1, f_has},
|
|
Karsten Hopp |
962e0f |
{"has_key", 2, 2, f_has_key},
|
|
Karsten Hopp |
962e0f |
***************
|
|
Karsten Hopp |
962e0f |
*** 10019,10032 ****
|
|
Karsten Hopp |
962e0f |
int options = WILD_SILENT|WILD_USE_NL|WILD_LIST_NOTFOUND;
|
|
Karsten Hopp |
962e0f |
expand_T xpc;
|
|
Karsten Hopp |
962e0f |
int error = FALSE;
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
rettv->v_type = VAR_STRING;
|
|
Karsten Hopp |
962e0f |
s = get_tv_string(&argvars[0]);
|
|
Karsten Hopp |
962e0f |
if (*s == '%' || *s == '#' || *s == '<')
|
|
Karsten Hopp |
962e0f |
{
|
|
Karsten Hopp |
962e0f |
++emsg_off;
|
|
Karsten Hopp |
962e0f |
! rettv->vval.v_string = eval_vars(s, s, &len, NULL, &errormsg, NULL);
|
|
Karsten Hopp |
962e0f |
--emsg_off;
|
|
Karsten Hopp |
962e0f |
}
|
|
Karsten Hopp |
962e0f |
else
|
|
Karsten Hopp |
962e0f |
{
|
|
Karsten Hopp |
962e0f |
--- 10019,10051 ----
|
|
Karsten Hopp |
962e0f |
int options = WILD_SILENT|WILD_USE_NL|WILD_LIST_NOTFOUND;
|
|
Karsten Hopp |
962e0f |
expand_T xpc;
|
|
Karsten Hopp |
962e0f |
int error = FALSE;
|
|
Karsten Hopp |
962e0f |
+ char_u *result;
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
rettv->v_type = VAR_STRING;
|
|
Karsten Hopp |
962e0f |
+ if (argvars[1].v_type != VAR_UNKNOWN
|
|
Karsten Hopp |
962e0f |
+ && argvars[2].v_type != VAR_UNKNOWN
|
|
Karsten Hopp |
962e0f |
+ && get_tv_number_chk(&argvars[2], &error)
|
|
Karsten Hopp |
962e0f |
+ && !error)
|
|
Karsten Hopp |
962e0f |
+ {
|
|
Karsten Hopp |
962e0f |
+ rettv->v_type = VAR_LIST;
|
|
Karsten Hopp |
962e0f |
+ rettv->vval.v_list = NULL;
|
|
Karsten Hopp |
962e0f |
+ }
|
|
Karsten Hopp |
962e0f |
+
|
|
Karsten Hopp |
962e0f |
s = get_tv_string(&argvars[0]);
|
|
Karsten Hopp |
962e0f |
if (*s == '%' || *s == '#' || *s == '<')
|
|
Karsten Hopp |
962e0f |
{
|
|
Karsten Hopp |
962e0f |
++emsg_off;
|
|
Karsten Hopp |
962e0f |
! result = eval_vars(s, s, &len, NULL, &errormsg, NULL);
|
|
Karsten Hopp |
962e0f |
--emsg_off;
|
|
Karsten Hopp |
962e0f |
+ if (rettv->v_type == VAR_LIST)
|
|
Karsten Hopp |
962e0f |
+ {
|
|
Karsten Hopp |
962e0f |
+ if (rettv_list_alloc(rettv) != FAIL && result != NULL)
|
|
Karsten Hopp |
962e0f |
+ list_append_string(rettv->vval.v_list, result, -1);
|
|
Karsten Hopp |
962e0f |
+ else
|
|
Karsten Hopp |
962e0f |
+ vim_free(result);
|
|
Karsten Hopp |
962e0f |
+ }
|
|
Karsten Hopp |
962e0f |
+ else
|
|
Karsten Hopp |
962e0f |
+ rettv->vval.v_string = result;
|
|
Karsten Hopp |
962e0f |
}
|
|
Karsten Hopp |
962e0f |
else
|
|
Karsten Hopp |
962e0f |
{
|
|
Karsten Hopp |
962e0f |
***************
|
|
Karsten Hopp |
962e0f |
*** 10041,10047 ****
|
|
Karsten Hopp |
962e0f |
xpc.xp_context = EXPAND_FILES;
|
|
Karsten Hopp |
962e0f |
if (p_wic)
|
|
Karsten Hopp |
962e0f |
options += WILD_ICASE;
|
|
Karsten Hopp |
962e0f |
! rettv->vval.v_string = ExpandOne(&xpc, s, NULL, options, WILD_ALL);
|
|
Karsten Hopp |
962e0f |
}
|
|
Karsten Hopp |
962e0f |
else
|
|
Karsten Hopp |
962e0f |
rettv->vval.v_string = NULL;
|
|
Karsten Hopp |
962e0f |
--- 10060,10077 ----
|
|
Karsten Hopp |
962e0f |
xpc.xp_context = EXPAND_FILES;
|
|
Karsten Hopp |
962e0f |
if (p_wic)
|
|
Karsten Hopp |
962e0f |
options += WILD_ICASE;
|
|
Karsten Hopp |
962e0f |
! if (rettv->v_type == VAR_STRING)
|
|
Karsten Hopp |
962e0f |
! rettv->vval.v_string = ExpandOne(&xpc, s, NULL,
|
|
Karsten Hopp |
962e0f |
! options, WILD_ALL);
|
|
Karsten Hopp |
962e0f |
! else if (rettv_list_alloc(rettv) != FAIL)
|
|
Karsten Hopp |
962e0f |
! {
|
|
Karsten Hopp |
962e0f |
! int i;
|
|
Karsten Hopp |
962e0f |
!
|
|
Karsten Hopp |
962e0f |
! ExpandOne(&xpc, s, NULL, options, WILD_ALL_KEEP);
|
|
Karsten Hopp |
962e0f |
! for (i = 0; i < xpc.xp_numfiles; i++)
|
|
Karsten Hopp |
962e0f |
! list_append_string(rettv->vval.v_list, xpc.xp_files[i], -1);
|
|
Karsten Hopp |
962e0f |
! ExpandCleanup(&xpc);
|
|
Karsten Hopp |
962e0f |
! }
|
|
Karsten Hopp |
962e0f |
}
|
|
Karsten Hopp |
962e0f |
else
|
|
Karsten Hopp |
962e0f |
rettv->vval.v_string = NULL;
|
|
Karsten Hopp |
962e0f |
***************
|
|
Karsten Hopp |
962e0f |
*** 11833,11851 ****
|
|
Karsten Hopp |
962e0f |
int error = FALSE;
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
/* When the optional second argument is non-zero, don't remove matches
|
|
Karsten Hopp |
962e0f |
! * for 'wildignore' and don't put matches for 'suffixes' at the end. */
|
|
Karsten Hopp |
962e0f |
! if (argvars[1].v_type != VAR_UNKNOWN
|
|
Karsten Hopp |
962e0f |
! && get_tv_number_chk(&argvars[1], &error))
|
|
Karsten Hopp |
962e0f |
! options |= WILD_KEEP_ALL;
|
|
Karsten Hopp |
962e0f |
rettv->v_type = VAR_STRING;
|
|
Karsten Hopp |
962e0f |
if (!error)
|
|
Karsten Hopp |
962e0f |
{
|
|
Karsten Hopp |
962e0f |
ExpandInit(&xpc);
|
|
Karsten Hopp |
962e0f |
xpc.xp_context = EXPAND_FILES;
|
|
Karsten Hopp |
962e0f |
if (p_wic)
|
|
Karsten Hopp |
962e0f |
options += WILD_ICASE;
|
|
Karsten Hopp |
962e0f |
! rettv->vval.v_string = ExpandOne(&xpc, get_tv_string(&argvars[0]),
|
|
Karsten Hopp |
962e0f |
NULL, options, WILD_ALL);
|
|
Karsten Hopp |
962e0f |
}
|
|
Karsten Hopp |
962e0f |
else
|
|
Karsten Hopp |
962e0f |
rettv->vval.v_string = NULL;
|
|
Karsten Hopp |
962e0f |
--- 11863,11901 ----
|
|
Karsten Hopp |
962e0f |
int error = FALSE;
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
/* When the optional second argument is non-zero, don't remove matches
|
|
Karsten Hopp |
962e0f |
! * for 'wildignore' and don't put matches for 'suffixes' at the end. */
|
|
Karsten Hopp |
962e0f |
rettv->v_type = VAR_STRING;
|
|
Karsten Hopp |
962e0f |
+ if (argvars[1].v_type != VAR_UNKNOWN)
|
|
Karsten Hopp |
962e0f |
+ {
|
|
Karsten Hopp |
962e0f |
+ if (get_tv_number_chk(&argvars[1], &error))
|
|
Karsten Hopp |
962e0f |
+ options |= WILD_KEEP_ALL;
|
|
Karsten Hopp |
962e0f |
+ if (argvars[2].v_type != VAR_UNKNOWN
|
|
Karsten Hopp |
962e0f |
+ && get_tv_number_chk(&argvars[2], &error))
|
|
Karsten Hopp |
962e0f |
+ {
|
|
Karsten Hopp |
962e0f |
+ rettv->v_type = VAR_LIST;
|
|
Karsten Hopp |
962e0f |
+ rettv->vval.v_list = NULL;
|
|
Karsten Hopp |
962e0f |
+ }
|
|
Karsten Hopp |
962e0f |
+ }
|
|
Karsten Hopp |
962e0f |
if (!error)
|
|
Karsten Hopp |
962e0f |
{
|
|
Karsten Hopp |
962e0f |
ExpandInit(&xpc);
|
|
Karsten Hopp |
962e0f |
xpc.xp_context = EXPAND_FILES;
|
|
Karsten Hopp |
962e0f |
if (p_wic)
|
|
Karsten Hopp |
962e0f |
options += WILD_ICASE;
|
|
Karsten Hopp |
962e0f |
! if (rettv->v_type == VAR_STRING)
|
|
Karsten Hopp |
962e0f |
! rettv->vval.v_string = ExpandOne(&xpc, get_tv_string(&argvars[0]),
|
|
Karsten Hopp |
962e0f |
NULL, options, WILD_ALL);
|
|
Karsten Hopp |
962e0f |
+ else if (rettv_list_alloc(rettv) != FAIL)
|
|
Karsten Hopp |
962e0f |
+ {
|
|
Karsten Hopp |
962e0f |
+ int i;
|
|
Karsten Hopp |
962e0f |
+
|
|
Karsten Hopp |
962e0f |
+ ExpandOne(&xpc, get_tv_string(&argvars[0]),
|
|
Karsten Hopp |
962e0f |
+ NULL, options, WILD_ALL_KEEP);
|
|
Karsten Hopp |
962e0f |
+ for (i = 0; i < xpc.xp_numfiles; i++)
|
|
Karsten Hopp |
962e0f |
+ list_append_string(rettv->vval.v_list, xpc.xp_files[i], -1);
|
|
Karsten Hopp |
962e0f |
+
|
|
Karsten Hopp |
962e0f |
+ ExpandCleanup(&xpc);
|
|
Karsten Hopp |
962e0f |
+ }
|
|
Karsten Hopp |
962e0f |
}
|
|
Karsten Hopp |
962e0f |
else
|
|
Karsten Hopp |
962e0f |
rettv->vval.v_string = NULL;
|
|
Karsten Hopp |
962e0f |
*** ../vim-7.3.464/src/ex_getln.c 2012-02-22 17:58:00.000000000 +0100
|
|
Karsten Hopp |
962e0f |
--- src/ex_getln.c 2012-03-07 19:07:01.000000000 +0100
|
|
Karsten Hopp |
962e0f |
***************
|
|
Karsten Hopp |
962e0f |
*** 3461,3466 ****
|
|
Karsten Hopp |
962e0f |
--- 3461,3467 ----
|
|
Karsten Hopp |
962e0f |
* mode = WILD_PREV: use previous match in multiple match, wrap to first
|
|
Karsten Hopp |
962e0f |
* mode = WILD_ALL: return all matches concatenated
|
|
Karsten Hopp |
962e0f |
* mode = WILD_LONGEST: return longest matched part
|
|
Karsten Hopp |
962e0f |
+ * mode = WILD_ALL_KEEP: get all matches, keep matches
|
|
Karsten Hopp |
962e0f |
*
|
|
Karsten Hopp |
962e0f |
* options = WILD_LIST_NOTFOUND: list entries without a match
|
|
Karsten Hopp |
962e0f |
* options = WILD_HOME_REPLACE: do home_replace() for buffer names
|
|
Karsten Hopp |
962e0f |
***************
|
|
Karsten Hopp |
962e0f |
*** 3584,3590 ****
|
|
Karsten Hopp |
962e0f |
/*
|
|
Karsten Hopp |
962e0f |
* Check for matching suffixes in file names.
|
|
Karsten Hopp |
962e0f |
*/
|
|
Karsten Hopp |
962e0f |
! if (mode != WILD_ALL && mode != WILD_LONGEST)
|
|
Karsten Hopp |
962e0f |
{
|
|
Karsten Hopp |
962e0f |
if (xp->xp_numfiles)
|
|
Karsten Hopp |
962e0f |
non_suf_match = xp->xp_numfiles;
|
|
Karsten Hopp |
962e0f |
--- 3585,3592 ----
|
|
Karsten Hopp |
962e0f |
/*
|
|
Karsten Hopp |
962e0f |
* Check for matching suffixes in file names.
|
|
Karsten Hopp |
962e0f |
*/
|
|
Karsten Hopp |
962e0f |
! if (mode != WILD_ALL && mode != WILD_ALL_KEEP
|
|
Karsten Hopp |
962e0f |
! && mode != WILD_LONGEST)
|
|
Karsten Hopp |
962e0f |
{
|
|
Karsten Hopp |
962e0f |
if (xp->xp_numfiles)
|
|
Karsten Hopp |
962e0f |
non_suf_match = xp->xp_numfiles;
|
|
Karsten Hopp |
962e0f |
*** ../vim-7.3.464/src/vim.h 2011-07-27 17:31:42.000000000 +0200
|
|
Karsten Hopp |
962e0f |
--- src/vim.h 2012-03-07 19:03:43.000000000 +0100
|
|
Karsten Hopp |
962e0f |
***************
|
|
Karsten Hopp |
962e0f |
*** 794,799 ****
|
|
Karsten Hopp |
962e0f |
--- 794,800 ----
|
|
Karsten Hopp |
962e0f |
#define WILD_PREV 5
|
|
Karsten Hopp |
962e0f |
#define WILD_ALL 6
|
|
Karsten Hopp |
962e0f |
#define WILD_LONGEST 7
|
|
Karsten Hopp |
962e0f |
+ #define WILD_ALL_KEEP 8
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
#define WILD_LIST_NOTFOUND 1
|
|
Karsten Hopp |
962e0f |
#define WILD_HOME_REPLACE 2
|
|
Karsten Hopp |
962e0f |
*** ../vim-7.3.464/src/version.c 2012-03-07 18:04:00.000000000 +0100
|
|
Karsten Hopp |
962e0f |
--- src/version.c 2012-03-07 19:14:39.000000000 +0100
|
|
Karsten Hopp |
962e0f |
***************
|
|
Karsten Hopp |
962e0f |
*** 716,717 ****
|
|
Karsten Hopp |
962e0f |
--- 716,719 ----
|
|
Karsten Hopp |
962e0f |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
962e0f |
+ /**/
|
|
Karsten Hopp |
962e0f |
+ 465,
|
|
Karsten Hopp |
962e0f |
/**/
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
--
|
|
Karsten Hopp |
962e0f |
Although the scythe isn't pre-eminent among the weapons of war, anyone who
|
|
Karsten Hopp |
962e0f |
has been on the wrong end of, say, a peasants' revolt will know that in
|
|
Karsten Hopp |
962e0f |
skilled hands it is fearsome.
|
|
Karsten Hopp |
962e0f |
-- (Terry Pratchett, Mort)
|
|
Karsten Hopp |
962e0f |
|
|
Karsten Hopp |
962e0f |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
962e0f |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
962e0f |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
962e0f |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|