Mirror of the Vim source from https://github.com/vim/vim
Révision | a81bc802c17ce7002b08d2e327136e3ac4d11d5a (tree) |
---|---|
l'heure | 2004-07-20 05:55:54 |
Auteur | vimboss |
Commiter | vimboss |
updated for version 7.0011
@@ -1,4 +1,4 @@ | ||
1 | -*eval.txt* For Vim version 7.0aa. Last change: 2004 Jul 18 | |
1 | +*eval.txt* For Vim version 7.0aa. Last change: 2004 Jul 19 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -831,6 +831,8 @@ | ||
831 | 831 | exists( {expr}) Number TRUE if {expr} exists |
832 | 832 | expand( {expr}) String expand special keywords in {expr} |
833 | 833 | filereadable( {file}) Number TRUE if {file} is a readable file |
834 | +findfile( {name}[, {path}[, {count}]]) | |
835 | + String Find fine {name} in {path} | |
834 | 836 | filewritable( {file}) Number TRUE if {file} is a writable file |
835 | 837 | fnamemodify( {fname}, {mods}) String modify file name |
836 | 838 | foldclosed( {lnum}) Number first line of fold at {lnum} if closed |
@@ -879,12 +881,12 @@ | ||
879 | 881 | localtime() Number current time |
880 | 882 | maparg( {name}[, {mode}]) String rhs of mapping {name} in mode {mode} |
881 | 883 | mapcheck( {name}[, {mode}]) String check for mappings matching {name} |
882 | -match( {expr}, {pat}[, {start}]) | |
884 | +match( {expr}, {pat}[, {start}[, {count}]]) | |
883 | 885 | Number position where {pat} matches in {expr} |
884 | -matchend( {expr}, {pat}[, {start}]) | |
886 | +matchend( {expr}, {pat}[, {start}[, {count}]]) | |
885 | 887 | Number position where {pat} ends in {expr} |
886 | -matchstr( {expr}, {pat}[, {start}]) | |
887 | - String match of {pat} in {expr} | |
888 | +matchstr( {expr}, {pat}[, {start}[, {count}]]) | |
889 | + String {count}'th match of {pat} in {expr} | |
888 | 890 | mode() String current editing mode |
889 | 891 | nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum} |
890 | 892 | nr2char( {expr}) String single char with ASCII value {expr} |
@@ -1412,6 +1414,23 @@ | ||
1412 | 1414 | *file_readable()* |
1413 | 1415 | Obsolete name: file_readable(). |
1414 | 1416 | |
1417 | +finddir({name}[, {path}[, {count}]]) *finddir()* | |
1418 | + Find directory {name} in {path}. | |
1419 | + If {path} is omitted or empty then 'path' is used. | |
1420 | + If the optional {count} is given, find {count}'s occurrence of | |
1421 | + {name} in {path}. | |
1422 | + This is quite similar to the ex-command |:find|. | |
1423 | + When the found directory is below the current directory a | |
1424 | + relative path is returned. Otherwise a full path is returned. | |
1425 | + Example: > | |
1426 | + :echo findfile("tags.vim", ".;") | |
1427 | +< Searches from the current directory upwards until it finds | |
1428 | + the file "tags.vim". | |
1429 | + {only available when compiled with the +file_in_path feature} | |
1430 | + | |
1431 | +findfile({name}[, {path}[, {count}]]) *findfile()* | |
1432 | + Just like |finddir()|, but find a file instead of a directory. | |
1433 | + | |
1415 | 1434 | filewritable({file}) *filewritable()* |
1416 | 1435 | The result is a Number, which is 1 when a file with the |
1417 | 1436 | name {file} exists, and can be written. If {file} doesn't |
@@ -2027,14 +2046,20 @@ | ||
2027 | 2046 | < This avoids adding the "_vv" mapping when there already is a |
2028 | 2047 | mapping for "_v" or for "_vvv". |
2029 | 2048 | |
2030 | -match({expr}, {pat}[, {start}]) *match()* | |
2049 | +match({expr}, {pat}[, {start}[, {count}]]) *match()* | |
2031 | 2050 | The result is a Number, which gives the index (byte offset) in |
2032 | - {expr} where {pat} matches. A match at the first character | |
2033 | - returns zero. If there is no match -1 is returned. Example: > | |
2051 | + {expr} where {pat} matches. | |
2052 | + A match at the first character returns zero. | |
2053 | + If there is no match -1 is returned. | |
2054 | + Example: > | |
2034 | 2055 | :echo match("testing", "ing") |
2035 | 2056 | < results in "4". |
2036 | 2057 | See |string-match| for how {pat} is used. |
2037 | - If {start} is given, the search starts from index {start}. | |
2058 | + When {count} is given use the {count}'th match. When a match | |
2059 | + is found the search for the next one starts on character | |
2060 | + further. Thus this example results in 1: > | |
2061 | + echo match("testing", "..", 0, 2) | |
2062 | +< If {start} is given, the search starts from index {start}. | |
2038 | 2063 | The result, however, is still the index counted from the |
2039 | 2064 | first character. Example: > |
2040 | 2065 | :echo match("testing", "ing", 2) |
@@ -2050,7 +2075,7 @@ | ||
2050 | 2075 | the pattern. 'smartcase' is NOT used. The matching is always |
2051 | 2076 | done like 'magic' is set and 'cpoptions' is empty. |
2052 | 2077 | |
2053 | -matchend({expr}, {pat}[, {start}]) *matchend()* | |
2078 | +matchend({expr}, {pat}[, {start}[, {count}]]) *matchend()* | |
2054 | 2079 | Same as match(), but return the index of first character after |
2055 | 2080 | the match. Example: > |
2056 | 2081 | :echo matchend("testing", "ing") |
@@ -2061,7 +2086,7 @@ | ||
2061 | 2086 | :echo matchend("testing", "ing", 5) |
2062 | 2087 | < result is "-1". |
2063 | 2088 | |
2064 | -matchstr({expr}, {pat}[, {start}]) *matchstr()* | |
2089 | +matchstr({expr}, {pat}[, {start}[, {count}]]) *matchstr()* | |
2065 | 2090 | Same as match(), but return the matched string. Example: > |
2066 | 2091 | :echo matchstr("testing", "ing") |
2067 | 2092 | < results in "ing". |
@@ -1,4 +1,4 @@ | ||
1 | -*os_mac.txt* For Vim version 7.0aa. Last change: 2004 Jun 19 | |
1 | +*os_mac.txt* For Vim version 7.0aa. Last change: 2004 Jul 19 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar et al. |
@@ -9,7 +9,7 @@ | ||
9 | 9 | This file documents the particularities of the Macintosh version of Vim. |
10 | 10 | |
11 | 11 | NOTE: This file is a bit outdated. You might find more useful info here: |
12 | - http://macvim.swdev.org/ | |
12 | + http://macvim.org/ | |
13 | 13 | |
14 | 14 | 1. Filename Convention |mac-filename| |
15 | 15 | 2. .vimrc an .vim files |mac-vimfile| |
@@ -4065,6 +4065,7 @@ | ||
4065 | 4065 | builtin_terms term.txt /*builtin_terms* |
4066 | 4066 | byte-count editing.txt /*byte-count* |
4067 | 4067 | byte2line() eval.txt /*byte2line()* |
4068 | +byteidx() eval.txt /*byteidx()* | |
4068 | 4069 | bzip2 pi_gzip.txt /*bzip2* |
4069 | 4070 | c change.txt /*c* |
4070 | 4071 | c-syntax syntax.txt /*c-syntax* |
@@ -4624,6 +4625,7 @@ | ||
4624 | 4625 | filter change.txt /*filter* |
4625 | 4626 | find-manpage usr_12.txt /*find-manpage* |
4626 | 4627 | find-replace usr_10.txt /*find-replace* |
4628 | +findfile() eval.txt /*findfile()* | |
4627 | 4629 | fixed-5.1 version5.txt /*fixed-5.1* |
4628 | 4630 | fixed-5.2 version5.txt /*fixed-5.2* |
4629 | 4631 | fixed-5.3 version5.txt /*fixed-5.3* |
@@ -1,4 +1,4 @@ | ||
1 | -*todo.txt* For Vim version 7.0aa. Last change: 2004 Jul 18 | |
1 | +*todo.txt* For Vim version 7.0aa. Last change: 2004 Jul 19 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -36,11 +36,6 @@ | ||
36 | 36 | For version 7.0: |
37 | 37 | - Include many PATCHES: |
38 | 38 | 8 Add functions: |
39 | - match({pat}, {string} [,start] [,count]) get index of count'th match | |
40 | - Patch by Ilya Sher, 2004 Jun 19 | |
41 | - find() find file in 'path' (patch from Johannes | |
42 | - Zellner 2001 Dec 20) | |
43 | - Update 2004 Jun 16. | |
44 | 39 | realname() Get user name (first, last, full) |
45 | 40 | user_fullname() patch by Nikolai Weibull, Nov |
46 | 41 | 3 2002) |
@@ -1,4 +1,4 @@ | ||
1 | -*version7.txt* For Vim version 7.0aa. Last change: 2004 Jul 18 | |
1 | +*version7.txt* For Vim version 7.0aa. Last change: 2004 Jul 19 | |
2 | 2 | |
3 | 3 | |
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -123,10 +123,13 @@ | ||
123 | 123 | |
124 | 124 | New functions: ~ |
125 | 125 | |
126 | +byteidx(expr, nr) |byteidx()| Index of a character. (Ilya Sher) | |
127 | +finddir(name) |finddir()| Find a directory in 'path'. | |
128 | +findfile(name) |findfile()| Find a file in 'path'. (Johannes | |
129 | + Zellner) | |
126 | 130 | repeat(expr, count) |repeat()| Repeat "expr" "count" times. |
127 | 131 | (Christophe Poucet) |
128 | 132 | tr(expr, from, to) |tr()| Translate characters. (Ron Aaron) |
129 | -byteidx(expr, nr) |byteidx()| Index of a character. (Ilya Sher) | |
130 | 133 | |
131 | 134 | |
132 | 135 | New autocommand events: ~ |
@@ -182,6 +185,8 @@ | ||
182 | 185 | - #\(, #\), #\[ and #\] are recognized as character literals |
183 | 186 | - Lisp line comments (delimited by semicolon) are recognized |
184 | 187 | |
188 | +Added the "count" argument to match(), matchend() and matchstr(). (Ilya Sher) | |
189 | + | |
185 | 190 | ============================================================================== |
186 | 191 | COMPILE TIME CHANGES *compile-changes-7* |
187 | 192 |
@@ -1,7 +1,7 @@ | ||
1 | 1 | " Vim syntax file |
2 | 2 | " Language: SQL, PL/SQL (Oracle 8i) |
3 | -" Maintainer: Paul Moore <gustav@morpheus.demon.co.uk> | |
4 | -" Last Change: 2001 Apr 30 | |
3 | +" Maintainer: Paul Moore <pf_moore AT yahoo.co.uk> | |
4 | +" Last Change: 2004 Jul 19 | |
5 | 5 | |
6 | 6 | " For version 5.x: Clear all syntax items |
7 | 7 | " For version 6.x: Quit when a syntax file was already loaded |
@@ -1,6 +1,6 @@ | ||
1 | 1 | " Vim syntax file |
2 | 2 | " Language: Windows Scripting Host |
3 | -" Maintainer: Paul Moore <gustav@morpheus.demon.co.uk> | |
3 | +" Maintainer: Paul Moore <pf_moore AT yahoo.co.uk> | |
4 | 4 | " Last Change: Fre, 24 Nov 2000 21:54:09 +0100 |
5 | 5 | |
6 | 6 | " This reuses the XML, VB and JavaScript syntax files. While VB is not |
@@ -852,13 +852,17 @@ | ||
852 | 852 | |
853 | 853 | $(OUTDIR)/glbl_ime.obj: $(OUTDIR) glbl_ime.cpp dimm.h $(INCL) |
854 | 854 | |
855 | +# $CFLAGS may contain backslashes and double quotes, escape them both. | |
856 | +E0_CFLAGS = $(CFLAGS:\=\\) | |
857 | +E_CFLAGS = $(E0_CFLAGS:"=\") | |
858 | + | |
855 | 859 | auto/pathdef.c: auto |
856 | 860 | @echo creating auto/pathdef.c |
857 | 861 | @echo /* pathdef.c */ > auto\pathdef.c |
858 | 862 | @echo #include "vim.h" >> auto\pathdef.c |
859 | 863 | @echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC:\=\\)"; >> auto\pathdef.c |
860 | 864 | @echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR:\=\\)"; >> auto\pathdef.c |
861 | - @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(CFLAGS:\=\\)"; >> auto\pathdef.c | |
865 | + @echo char_u *all_cflags = (char_u *)"$(CC:\=\\) $(E_CFLAGS)"; >> auto\pathdef.c | |
862 | 866 | @echo char_u *all_lflags = (char_u *)"$(link:\=\\) $(LINKARGS1:\=\\) $(LINKARGS2:\=\\)"; >> auto\pathdef.c |
863 | 867 | @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> auto\pathdef.c |
864 | 868 | @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> auto\pathdef.c |
@@ -279,6 +279,9 @@ | ||
279 | 279 | static void f_expand __ARGS((VAR argvars, VAR retvar)); |
280 | 280 | static void f_filereadable __ARGS((VAR argvars, VAR retvar)); |
281 | 281 | static void f_filewritable __ARGS((VAR argvars, VAR retvar)); |
282 | +static void f_finddir __ARGS((VAR argvars, VAR retvar)); | |
283 | +static void f_findfile __ARGS((VAR argvars, VAR retvar)); | |
284 | +static void f_findfilendir __ARGS((VAR argvars, VAR retvar, int dir)); | |
282 | 285 | static void f_fnamemodify __ARGS((VAR argvars, VAR retvar)); |
283 | 286 | static void f_foldclosed __ARGS((VAR argvars, VAR retvar)); |
284 | 287 | static void f_foldclosedend __ARGS((VAR argvars, VAR retvar)); |
@@ -2836,6 +2839,8 @@ | ||
2836 | 2839 | {"file_readable", 1, 1, f_filereadable}, /* obsolete */ |
2837 | 2840 | {"filereadable", 1, 1, f_filereadable}, |
2838 | 2841 | {"filewritable", 1, 1, f_filewritable}, |
2842 | + {"finddir", 1, 3, f_finddir}, | |
2843 | + {"findfile", 1, 3, f_findfile}, | |
2839 | 2844 | {"fnamemodify", 2, 2, f_fnamemodify}, |
2840 | 2845 | {"foldclosed", 1, 1, f_foldclosed}, |
2841 | 2846 | {"foldclosedend", 1, 1, f_foldclosedend}, |
@@ -2886,9 +2891,9 @@ | ||
2886 | 2891 | {"localtime", 0, 0, f_localtime}, |
2887 | 2892 | {"maparg", 1, 2, f_maparg}, |
2888 | 2893 | {"mapcheck", 1, 2, f_mapcheck}, |
2889 | - {"match", 2, 3, f_match}, | |
2890 | - {"matchend", 2, 3, f_matchend}, | |
2891 | - {"matchstr", 2, 3, f_matchstr}, | |
2894 | + {"match", 2, 4, f_match}, | |
2895 | + {"matchend", 2, 4, f_matchend}, | |
2896 | + {"matchstr", 2, 4, f_matchstr}, | |
2892 | 2897 | {"mode", 0, 0, f_mode}, |
2893 | 2898 | {"nextnonblank", 1, 1, f_nextnonblank}, |
2894 | 2899 | {"nr2char", 1, 1, f_nr2char}, |
@@ -4168,6 +4173,71 @@ | ||
4168 | 4173 | } |
4169 | 4174 | |
4170 | 4175 | /* |
4176 | + * "finddir({fname}[, {path}[, {count}]])" function | |
4177 | + */ | |
4178 | + static void | |
4179 | +f_finddir(argvars, retvar) | |
4180 | + VAR argvars; | |
4181 | + VAR retvar; | |
4182 | +{ | |
4183 | + f_findfilendir(argvars, retvar, TRUE); | |
4184 | +} | |
4185 | + | |
4186 | +/* | |
4187 | + * "findfile({fname}[, {path}[, {count}]])" function | |
4188 | + */ | |
4189 | + static void | |
4190 | +f_findfile(argvars, retvar) | |
4191 | + VAR argvars; | |
4192 | + VAR retvar; | |
4193 | +{ | |
4194 | + f_findfilendir(argvars, retvar, FALSE); | |
4195 | +} | |
4196 | + | |
4197 | + static void | |
4198 | +f_findfilendir(argvars, retvar, dir) | |
4199 | + VAR argvars; | |
4200 | + VAR retvar; | |
4201 | + int dir; | |
4202 | +{ | |
4203 | +#ifdef FEAT_SEARCHPATH | |
4204 | + char_u *fname; | |
4205 | + char_u *fresult = NULL; | |
4206 | + char_u *path = *curbuf->b_p_path == NUL ? p_path : curbuf->b_p_path; | |
4207 | + char_u *p; | |
4208 | + char_u pathbuf[NUMBUFLEN]; | |
4209 | + int count = 1; | |
4210 | + int first = TRUE; | |
4211 | + | |
4212 | + fname = get_var_string(&argvars[0]); | |
4213 | + | |
4214 | + if (argvars[1].var_type != VAR_UNKNOWN) | |
4215 | + { | |
4216 | + p = get_var_string_buf(&argvars[1], pathbuf); | |
4217 | + if (*p != NUL) | |
4218 | + path = p; | |
4219 | + | |
4220 | + if (argvars[2].var_type != VAR_UNKNOWN) | |
4221 | + count = get_var_number(&argvars[2]); | |
4222 | + } | |
4223 | + | |
4224 | + do | |
4225 | + { | |
4226 | + vim_free(fresult); | |
4227 | + fresult = find_file_in_path_option(first ? fname : NULL, | |
4228 | + first ? (int)STRLEN(fname) : 0, | |
4229 | + 0, first, path, dir, NULL); | |
4230 | + first = FALSE; | |
4231 | + } while (--count > 0 && fresult != NULL); | |
4232 | + | |
4233 | + retvar->var_val.var_string = fresult; | |
4234 | +#else | |
4235 | + retvar->var_val.var_string = NULL; | |
4236 | +#endif | |
4237 | + retvar->var_type = VAR_STRING; | |
4238 | +} | |
4239 | + | |
4240 | +/* | |
4171 | 4241 | * "fnamemodify({fname}, {mods})" function |
4172 | 4242 | */ |
4173 | 4243 | static void |
@@ -5858,17 +5928,20 @@ | ||
5858 | 5928 | int type; |
5859 | 5929 | { |
5860 | 5930 | char_u *str; |
5931 | + char_u *expr; | |
5861 | 5932 | char_u *pat; |
5862 | 5933 | regmatch_T regmatch; |
5863 | 5934 | char_u patbuf[NUMBUFLEN]; |
5864 | 5935 | char_u *save_cpo; |
5865 | 5936 | long start = 0; |
5937 | + long nth = 1; | |
5938 | + int match; | |
5866 | 5939 | |
5867 | 5940 | /* Make 'cpoptions' empty, the 'l' flag should not be used here. */ |
5868 | 5941 | save_cpo = p_cpo; |
5869 | 5942 | p_cpo = (char_u *)""; |
5870 | 5943 | |
5871 | - str = get_var_string(&argvars[0]); | |
5944 | + expr = str = get_var_string(&argvars[0]); | |
5872 | 5945 | pat = get_var_string_buf(&argvars[1], patbuf); |
5873 | 5946 | |
5874 | 5947 | if (type == 2) |
@@ -5887,13 +5960,30 @@ | ||
5887 | 5960 | if (start > (long)STRLEN(str)) |
5888 | 5961 | goto theend; |
5889 | 5962 | str += start; |
5963 | + | |
5964 | + if (argvars[3].var_type != VAR_UNKNOWN) | |
5965 | + nth = get_var_number(&argvars[3]); | |
5890 | 5966 | } |
5891 | 5967 | |
5892 | 5968 | regmatch.regprog = vim_regcomp(pat, RE_MAGIC + RE_STRING); |
5893 | 5969 | if (regmatch.regprog != NULL) |
5894 | 5970 | { |
5895 | 5971 | regmatch.rm_ic = p_ic; |
5896 | - if (vim_regexec_nl(®match, str, (colnr_T)0)) | |
5972 | + | |
5973 | + while (1) | |
5974 | + { | |
5975 | + match = vim_regexec_nl(®match, str, (colnr_T)0); | |
5976 | + if (!match || --nth <= 0) | |
5977 | + break; | |
5978 | + /* Advance to just after the match. */ | |
5979 | +#ifdef FEAT_MBYTE | |
5980 | + str = regmatch.startp[0] + mb_ptr2len_check(regmatch.startp[0]); | |
5981 | +#else | |
5982 | + str = regmatch.startp[0] + 1; | |
5983 | +#endif | |
5984 | + } | |
5985 | + | |
5986 | + if (match) | |
5897 | 5987 | { |
5898 | 5988 | if (type == 2) |
5899 | 5989 | retvar->var_val.var_string = vim_strnsave(regmatch.startp[0], |
@@ -5906,7 +5996,7 @@ | ||
5906 | 5996 | else |
5907 | 5997 | retvar->var_val.var_number = |
5908 | 5998 | (varnumber_T)(regmatch.endp[0] - str); |
5909 | - retvar->var_val.var_number += start; | |
5999 | + retvar->var_val.var_number += str - expr; | |
5910 | 6000 | } |
5911 | 6001 | } |
5912 | 6002 | vim_free(regmatch.regprog); |
@@ -4251,12 +4251,12 @@ | ||
4251 | 4251 | { |
4252 | 4252 | |
4253 | 4253 | Handle textOfClip; |
4254 | + int flavor = 0; | |
4254 | 4255 | #ifdef USE_CARBONIZED |
4255 | 4256 | Size scrapSize; |
4256 | 4257 | ScrapFlavorFlags scrapFlags; |
4257 | 4258 | ScrapRef scrap = nil; |
4258 | 4259 | OSStatus error; |
4259 | - int flavor; | |
4260 | 4260 | #else |
4261 | 4261 | long scrapOffset; |
4262 | 4262 | long scrapSize; |
@@ -4271,7 +4271,6 @@ | ||
4271 | 4271 | if (error != noErr) |
4272 | 4272 | return; |
4273 | 4273 | |
4274 | - flavor = 0; | |
4275 | 4274 | error = GetScrapFlavorFlags(scrap, VIMSCRAPFLAVOR, &scrapFlags); |
4276 | 4275 | if (error == noErr) |
4277 | 4276 | { |
@@ -4315,15 +4314,16 @@ | ||
4315 | 4314 | #else |
4316 | 4315 | scrapSize = GetScrap(textOfClip, 'TEXT', &scrapOffset); |
4317 | 4316 | #endif |
4317 | + scrapSize -= flavor; | |
4318 | 4318 | |
4319 | 4319 | if (flavor) |
4320 | 4320 | type = **textOfClip; |
4321 | 4321 | else |
4322 | 4322 | type = (strchr(*textOfClip, '\r') != NULL) ? MLINE : MCHAR; |
4323 | 4323 | |
4324 | - tempclip = lalloc(scrapSize+1, TRUE); | |
4325 | - STRNCPY(tempclip, *textOfClip + flavor, scrapSize - flavor); | |
4326 | - tempclip[scrapSize - flavor] = 0; | |
4324 | + tempclip = lalloc(scrapSize + 1, TRUE); | |
4325 | + STRNCPY(tempclip, *textOfClip + flavor, scrapSize); | |
4326 | + tempclip[scrapSize] = 0; | |
4327 | 4327 | |
4328 | 4328 | searchCR = (char *)tempclip; |
4329 | 4329 | while (searchCR != NULL) |
@@ -3457,10 +3457,6 @@ | ||
3457 | 3457 | static int ff_path_in_stoplist __ARGS((char_u *, int, char_u **)); |
3458 | 3458 | #endif |
3459 | 3459 | |
3460 | -#ifdef FEAT_SEARCHPATH | |
3461 | -static char_u *find_file_in_path_option __ARGS((char_u *ptr, int len, int options, int first, char_u *path_option, int need_dir, char_u *rel_fname)); | |
3462 | -#endif | |
3463 | - | |
3464 | 3460 | #if 0 |
3465 | 3461 | /* |
3466 | 3462 | * if someone likes findfirst/findnext, here are the functions |
@@ -4860,7 +4856,7 @@ | ||
4860 | 4856 | TRUE, rel_fname); |
4861 | 4857 | } |
4862 | 4858 | |
4863 | - static char_u * | |
4859 | + char_u * | |
4864 | 4860 | find_file_in_path_option(ptr, len, options, first, path_option, need_dir, rel_fname) |
4865 | 4861 | char_u *ptr; /* file name */ |
4866 | 4862 | int len; /* length of file name */ |
@@ -82,6 +82,7 @@ | ||
82 | 82 | void vim_findfile_free_visited __ARGS((void *search_ctx)); |
83 | 83 | char_u *find_file_in_path __ARGS((char_u *ptr, int len, int options, int first, char_u *rel_fname)); |
84 | 84 | char_u *find_directory_in_path __ARGS((char_u *ptr, int len, int options, char_u *rel_fname)); |
85 | +char_u *find_file_in_path_option __ARGS((char_u *ptr, int len, int options, int first, char_u *path_option, int need_dir, char_u *rel_fname)); | |
85 | 86 | int vim_chdir __ARGS((char_u *new_dir)); |
86 | 87 | int get_user_name __ARGS((char_u *buf, int len)); |
87 | 88 | void sort_strings __ARGS((char_u **files, int count)); |
@@ -32,7 +32,7 @@ | ||
32 | 32 | $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG) |
33 | 33 | |
34 | 34 | clean: |
35 | - -rm -rf *.out *.rej *.orig test.log tiny.vim small.vim mbyte.vim test.ok X* viminfo | |
35 | + -rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim test.ok X* viminfo | |
36 | 36 | |
37 | 37 | test1.out: test1.in |
38 | 38 | -rm -f $*.failed tiny.vim small.vim mbyte.vim test.ok X* viminfo |
@@ -1,4 +1,4 @@ | ||
1 | -Test for 'scrollbind'. <eralston@computer.org> | |
1 | +Test for 'scrollbind'. <eralston@computer.org> Do not add a line below! | |
2 | 2 | STARTTEST |
3 | 3 | :so small.vim |
4 | 4 | :set noscrollbind |
@@ -1,4 +1,5 @@ | ||
1 | 1 | Tests for regexp with multi-byte encoding and various magic settings. |
2 | +Test matchstr() with a count and multi-byte chars. | |
2 | 3 | |
3 | 4 | STARTTEST |
4 | 5 | :so mbyte.vim |
@@ -21,6 +22,12 @@ | ||
21 | 22 | x:" find word by change of word class |
22 | 23 | /ち\<カヨ\>は |
23 | 24 | x:?^1?,$w! test.out |
25 | +:e! test.out | |
26 | +G:put =matchstr(\"אבגד\", \".\", 0, 2) " ב | |
27 | +:put =matchstr(\"אבגד\", \"..\", 0, 2) " בג | |
28 | +:put =matchstr(\"אבגד\", \".\", 0, 0) " א | |
29 | +:put =matchstr(\"אבגד\", \".\", 4, -1) " ג | |
30 | +:w! | |
24 | 31 | :qa! |
25 | 32 | ENDTEST |
26 | 33 |
@@ -9,3 +9,7 @@ | ||
9 | 9 | 9 หม่x อx |
10 | 10 | a อมx หx |
11 | 11 | b カヨは |
12 | +ב | |
13 | +בג | |
14 | +א | |
15 | +ג |
@@ -1,5 +1,9 @@ | ||
1 | 1 | Tests for string text objects. vim: set ft=vim : |
2 | 2 | |
3 | +Note that the end-of-line moves the cursor to the next test line. | |
4 | + | |
5 | +Also test match() and matchstr() | |
6 | + | |
3 | 7 | STARTTEST |
4 | 8 | :so small.vim |
5 | 9 | /^start:/ |
@@ -11,6 +15,12 @@ | ||
11 | 15 | :set quoteescape=+*- |
12 | 16 | di` |
13 | 17 | $F"va"oha"i"rz |
18 | +k:put =matchstr(\"abcd\", \".\", 0, 2) " b | |
19 | +:put =matchstr(\"abcd\", \"..\", 0, 2) " bc | |
20 | +:put =matchstr(\"abcd\", \".\", 2, 0) " c (zero and negative -> first match) | |
21 | +:put =matchstr(\"abcd\", \".\", 0, -1) " a | |
22 | +:put =match(\"abcd\", \".\", 0, 5) " -1 | |
23 | +:put =match(\"abcd\", \".\", 0, -1) " 0 | |
14 | 24 | :/^start:/,/^end:/wq! test.out |
15 | 25 | ENDTEST |
16 | 26 |
@@ -5,4 +5,10 @@ | ||
5 | 5 | "'" 'blah'yyyyy'buh' |
6 | 6 | bla `` b`la |
7 | 7 | voo "zzzzzzzzzzzzzzzzzzzzzzzzzzzzsd |
8 | +b | |
9 | +bc | |
10 | +c | |
11 | +a | |
12 | +-1 | |
13 | +0 | |
8 | 14 | end: |