mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:7.4.688 #2941
``` updated for version 7.4.668 Problem: Can't use a glob pattern as a regexp pattern. Solution: Add glob2regpat(). (Christian Brabandt) ``` https://code.google.com/p/vim/source/detail?r=v7-4-668
This commit is contained in:
parent
9a72f6b955
commit
59784b91db
@ -1833,6 +1833,7 @@ getwinvar( {nr}, {varname} [, {def}])
|
|||||||
any variable {varname} in window {nr}
|
any variable {varname} in window {nr}
|
||||||
glob( {expr} [, {nosuf} [, {list}]])
|
glob( {expr} [, {nosuf} [, {list}]])
|
||||||
any expand file wildcards in {expr}
|
any expand file wildcards in {expr}
|
||||||
|
glob2regpat( {expr}) String convert a glob pat into a search pat
|
||||||
globpath( {path}, {expr} [, {nosuf} [, {list}]])
|
globpath( {path}, {expr} [, {nosuf} [, {list}]])
|
||||||
String do glob({expr}) for all dirs in {path}
|
String do glob({expr}) for all dirs in {path}
|
||||||
has( {feature}) Number TRUE if feature {feature} supported
|
has( {feature}) Number TRUE if feature {feature} supported
|
||||||
@ -3646,6 +3647,14 @@ glob({expr} [, {nosuf} [, {list}]]) *glob()*
|
|||||||
See |expand()| for expanding special Vim variables. See
|
See |expand()| for expanding special Vim variables. See
|
||||||
|system()| for getting the raw output of an external command.
|
|system()| for getting the raw output of an external command.
|
||||||
|
|
||||||
|
glob2regpat({expr}) *glob2regpat()*
|
||||||
|
Convert a file pattern, as used by glob(), into a search
|
||||||
|
pattern. The result can be used to match with a string that
|
||||||
|
is a file name. E.g. >
|
||||||
|
if filename =~ glob2regpat('Make*.mak')
|
||||||
|
< This is equivalent to: >
|
||||||
|
if filename =~ '^Make.*\.mak$'
|
||||||
|
<
|
||||||
globpath({path}, {expr} [, {nosuf} [, {list}]]) *globpath()*
|
globpath({path}, {expr} [, {nosuf} [, {list}]]) *globpath()*
|
||||||
Perform glob() on all directories in {path} and concatenate
|
Perform glob() on all directories in {path} and concatenate
|
||||||
the results. Example: >
|
the results. Example: >
|
||||||
|
@ -6512,6 +6512,7 @@ static struct fst {
|
|||||||
{"getwinposy", 0, 0, f_getwinposy},
|
{"getwinposy", 0, 0, f_getwinposy},
|
||||||
{"getwinvar", 2, 3, f_getwinvar},
|
{"getwinvar", 2, 3, f_getwinvar},
|
||||||
{"glob", 1, 3, f_glob},
|
{"glob", 1, 3, f_glob},
|
||||||
|
{"glob2regpat", 1, 1, f_glob2regpat},
|
||||||
{"globpath", 2, 4, f_globpath},
|
{"globpath", 2, 4, f_globpath},
|
||||||
{"has", 1, 1, f_has},
|
{"has", 1, 1, f_has},
|
||||||
{"has_key", 2, 2, f_has_key},
|
{"has_key", 2, 2, f_has_key},
|
||||||
@ -9893,6 +9894,17 @@ static void f_globpath(typval_T *argvars, typval_T *rettv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* "glob2regpat()" function
|
||||||
|
*/
|
||||||
|
static void f_glob2regpat(typval_T *argvars, typval_T *rettv)
|
||||||
|
{
|
||||||
|
char_u *pat = get_tv_string_chk(&argvars[0]);
|
||||||
|
|
||||||
|
rettv->v_type = VAR_STRING;
|
||||||
|
rettv->vval.v_string = file_pat_to_reg_pat(pat, NULL, NULL, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "has()" function
|
* "has()" function
|
||||||
*/
|
*/
|
||||||
|
@ -181,7 +181,7 @@ static int included_patches[] = {
|
|||||||
//671,
|
//671,
|
||||||
//670,
|
//670,
|
||||||
//669 NA
|
//669 NA
|
||||||
//668,
|
668,
|
||||||
//667,
|
//667,
|
||||||
//666 NA
|
//666 NA
|
||||||
//665,
|
//665,
|
||||||
|
Loading…
Reference in New Issue
Block a user