To: vim_dev@googlegroups.com Subject: Patch 8.1.1921 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.1921 Problem: More functions can be used as methods. Solution: Make various functions usable as a method. Files: runtime/doc/eval.txt, src/evalfunc.c, src/testdir/test_expand.vim, src/testdir/test_expand_func.vim, src/testdir/test_expr.vim, src/testdir/test_findfile.vim, src/testdir/test_fnameescape.vim, src/testdir/test_fnamemodify.vim, src/testdir/test_fold.vim, src/testdir/test_functions.vim, src/testdir/test_search.vim, src/testdir/test_vimscript.vim *** ../vim-8.1.1920/runtime/doc/eval.txt 2019-08-23 22:31:33.213176889 +0200 --- runtime/doc/eval.txt 2019-08-24 20:42:55.015312693 +0200 *************** *** 3920,3925 **** --- 3925,3931 ---- For a long |List| this is much faster than comparing the length with zero. + Can also be used as a |method|: > mylist->empty() *************** *** 3931,3936 **** --- 3937,3945 ---- c:\\program\ files\\vim < Also see |shellescape()| and |fnameescape()|. + Can also be used as a |method|: > + GetText()->escape(' \') + < *eval()* eval({string}) Evaluate {string} and return the result. Especially useful to turn the result of |string()| back into the original value. *************** *** 3972,3977 **** --- 3981,3989 ---- -1 not implemented on this system |exepath()| can be used to get the full path of an executable. + Can also be used as a |method|: > + GetCommand()->executable() + execute({command} [, {silent}]) *execute()* Execute an Ex command or commands and return the output as a string. *************** *** 4001,4006 **** --- 4013,4021 ---- When used recursively the output of the recursive call is not included in the output of the higher level call. + Can also be used as a |method|: > + GetCommand()->execute() + exepath({expr}) *exepath()* If {expr} is an executable and is either an absolute path, a relative path or found in $PATH, return the full path. *************** *** 4010,4015 **** --- 4025,4033 ---- < If {expr} cannot be found in $PATH or is not executable then an empty string is returned. + Can also be used as a |method|: > + GetCommand()->exepath() + *exists()* exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined, zero otherwise. *************** *** 4095,4100 **** --- 4113,4121 ---- < This doesn't check for existence of the "bufcount" variable, but gets the value of "bufcount", and checks if that exists. + Can also be used as a |method|: > + Varname()->exists() + exp({expr}) *exp()* Return the exponential of {expr} as a |Float| in the range [0, inf]. *************** *** 4195,4200 **** --- 4216,4224 ---- See |glob()| for finding existing files. See |system()| for getting the raw output of an external command. + Can also be used as a |method|: > + Getpattern()->expand() + expandcmd({expr}) *expandcmd()* Expand special items in {expr} like what is done for an Ex command such as `:edit`. This expands special keywords, like *************** *** 4202,4207 **** --- 4226,4234 ---- {expr}. Returns the expanded string. Example: > :echo expandcmd('make %<.o') + + < Can also be used as a |method|: > + GetCommand()->expandcmd() < extend({expr1}, {expr2} [, {expr3}]) *extend()* {expr1} and {expr2} must be both |Lists| or both *************** *** 4291,4296 **** --- 4318,4326 ---- Return value is always 0. + Can also be used as a |method|: > + GetInput()->feedkeys() + filereadable({file}) *filereadable()* The result is a Number, which is |TRUE| when a file with the name {file} exists, and can be read. If {file} doesn't exist, *************** *** 4298,4304 **** expression, which is used as a String. If you don't care about the file being readable you can use |glob()|. ! *file_readable()* Obsolete name: file_readable(). --- 4328,4342 ---- expression, which is used as a String. If you don't care about the file being readable you can use |glob()|. ! {file} is used as-is, you may want to expand wildcards first: > ! echo filereadable('~/.vimrc') ! 0 ! echo filereadable(expand('~/.vimrc')) ! 1 ! ! < Can also be used as a |method|: > ! GetName()->filereadable() ! < *file_readable()* Obsolete name: file_readable(). *************** *** 4308,4313 **** --- 4346,4354 ---- exist, or is not writable, the result is 0. If {file} is a directory, and we can write to it, the result is 2. + Can also be used as a |method|: > + GetName()->filewriteable() + filter({expr1}, {expr2}) *filter()* {expr1} must be a |List| or a |Dictionary|. *************** *** 4373,4378 **** --- 4414,4422 ---- {only available when compiled with the |+file_in_path| feature} + Can also be used as a |method|: > + GetName()->finddir() + findfile({name} [, {path} [, {count}]]) *findfile()* Just like |finddir()|, but find a file instead of a directory. Uses 'suffixesadd'. *************** *** 4381,4386 **** --- 4425,4433 ---- < Searches from the directory of the current file upwards until it finds the file "tags.vim". + Can also be used as a |method|: > + GetName()->findfile() + float2nr({expr}) *float2nr()* Convert {expr} to a Number by omitting the part after the decimal point. *************** *** 4460,4465 **** --- 4507,4515 ---- :exe "edit " . fnameescape(fname) < results in executing: > edit \+some\ str\%nge\|name + < + Can also be used as a |method|: > + GetName()->fnameescape() fnamemodify({fname}, {mods}) *fnamemodify()* Modify file name {fname} according to {mods}. {mods} is a *************** *** 4472,4487 **** --- 4522,4546 ---- < Note: Environment variables don't work in {fname}, use |expand()| first then. + Can also be used as a |method|: > + GetName()->fnamemodify(':p:h') + foldclosed({lnum}) *foldclosed()* The result is a Number. If the line {lnum} is in a closed fold, the result is the number of the first line in that fold. If the line {lnum} is not in a closed fold, -1 is returned. + Can also be used as a |method|: > + GetLnum()->foldclosed() + foldclosedend({lnum}) *foldclosedend()* The result is a Number. If the line {lnum} is in a closed fold, the result is the number of the last line in that fold. If the line {lnum} is not in a closed fold, -1 is returned. + Can also be used as a |method|: > + GetLnum()->foldclosedend() + foldlevel({lnum}) *foldlevel()* The result is a Number, which is the foldlevel of line {lnum} in the current buffer. For nested folds the deepest level is *************** *** 4492,4497 **** --- 4551,4559 ---- foldlevel is unknown. As a special case the level of the previous line is usually available. + Can also be used as a |method|: > + GetLnum()->foldlevel() + *foldtext()* foldtext() Returns a String, to be displayed for a closed fold. This is the default function used for the 'foldtext' option and should *************** *** 4519,4524 **** --- 4581,4590 ---- Useful when exporting folded text, e.g., to HTML. {not available when compiled without the |+folding| feature} + + Can also be used as a |method|: > + GetLnum()->foldtextresult() + < *foreground()* foreground() Move the Vim window to the foreground. Useful when sent from a client to a Vim server. |remote_send()| *************** *** 4538,4543 **** --- 4604,4612 ---- Also for autoloaded functions. {name} cannot be a builtin function. + Can also be used as a |method|: > + GetFuncname()->funcref([arg]) + < *function()* *E700* *E922* *E923* function({name} [, {arglist}] [, {dict}]) Return a |Funcref| variable that refers to function {name}. *************** *** 4613,4618 **** --- 4682,4690 ---- call Func(500) < Invokes the function as with: > call context.Callback('one', 500) + < + Can also be used as a |method|: > + GetFuncname()->function([arg]) garbagecollect([{atexit}]) *garbagecollect()* *** ../vim-8.1.1920/src/evalfunc.c 2019-08-23 22:31:33.213176889 +0200 --- src/evalfunc.c 2019-08-24 20:42:11.131501640 +0200 *************** *** 523,563 **** {"diff_hlID", 2, 2, FEARG_1, f_diff_hlID}, {"empty", 1, 1, FEARG_1, f_empty}, {"environ", 0, 0, 0, f_environ}, ! {"escape", 2, 2, 0, f_escape}, {"eval", 1, 1, FEARG_1, f_eval}, {"eventhandler", 0, 0, 0, f_eventhandler}, ! {"executable", 1, 1, 0, f_executable}, ! {"execute", 1, 2, 0, f_execute}, ! {"exepath", 1, 1, 0, f_exepath}, ! {"exists", 1, 1, 0, f_exists}, #ifdef FEAT_FLOAT {"exp", 1, 1, FEARG_1, f_exp}, #endif ! {"expand", 1, 3, 0, f_expand}, ! {"expandcmd", 1, 1, 0, f_expandcmd}, {"extend", 2, 3, FEARG_1, f_extend}, ! {"feedkeys", 1, 2, 0, f_feedkeys}, ! {"file_readable", 1, 1, 0, f_filereadable}, // obsolete ! {"filereadable", 1, 1, 0, f_filereadable}, ! {"filewritable", 1, 1, 0, f_filewritable}, {"filter", 2, 2, FEARG_1, f_filter}, ! {"finddir", 1, 3, 0, f_finddir}, ! {"findfile", 1, 3, 0, f_findfile}, #ifdef FEAT_FLOAT {"float2nr", 1, 1, FEARG_1, f_float2nr}, {"floor", 1, 1, FEARG_1, f_floor}, {"fmod", 2, 2, FEARG_1, f_fmod}, #endif ! {"fnameescape", 1, 1, 0, f_fnameescape}, ! {"fnamemodify", 2, 2, 0, f_fnamemodify}, ! {"foldclosed", 1, 1, 0, f_foldclosed}, ! {"foldclosedend", 1, 1, 0, f_foldclosedend}, ! {"foldlevel", 1, 1, 0, f_foldlevel}, {"foldtext", 0, 0, 0, f_foldtext}, ! {"foldtextresult", 1, 1, 0, f_foldtextresult}, {"foreground", 0, 0, 0, f_foreground}, ! {"funcref", 1, 3, 0, f_funcref}, ! {"function", 1, 3, 0, f_function}, {"garbagecollect", 0, 1, 0, f_garbagecollect}, {"get", 2, 3, FEARG_1, f_get}, {"getbufinfo", 0, 1, 0, f_getbufinfo}, --- 523,563 ---- {"diff_hlID", 2, 2, FEARG_1, f_diff_hlID}, {"empty", 1, 1, FEARG_1, f_empty}, {"environ", 0, 0, 0, f_environ}, ! {"escape", 2, 2, FEARG_1, f_escape}, {"eval", 1, 1, FEARG_1, f_eval}, {"eventhandler", 0, 0, 0, f_eventhandler}, ! {"executable", 1, 1, FEARG_1, f_executable}, ! {"execute", 1, 2, FEARG_1, f_execute}, ! {"exepath", 1, 1, FEARG_1, f_exepath}, ! {"exists", 1, 1, FEARG_1, f_exists}, #ifdef FEAT_FLOAT {"exp", 1, 1, FEARG_1, f_exp}, #endif ! {"expand", 1, 3, FEARG_1, f_expand}, ! {"expandcmd", 1, 1, FEARG_1, f_expandcmd}, {"extend", 2, 3, FEARG_1, f_extend}, ! {"feedkeys", 1, 2, FEARG_1, f_feedkeys}, ! {"file_readable", 1, 1, FEARG_1, f_filereadable}, // obsolete ! {"filereadable", 1, 1, FEARG_1, f_filereadable}, ! {"filewritable", 1, 1, FEARG_1, f_filewritable}, {"filter", 2, 2, FEARG_1, f_filter}, ! {"finddir", 1, 3, FEARG_1, f_finddir}, ! {"findfile", 1, 3, FEARG_1, f_findfile}, #ifdef FEAT_FLOAT {"float2nr", 1, 1, FEARG_1, f_float2nr}, {"floor", 1, 1, FEARG_1, f_floor}, {"fmod", 2, 2, FEARG_1, f_fmod}, #endif ! {"fnameescape", 1, 1, FEARG_1, f_fnameescape}, ! {"fnamemodify", 2, 2, FEARG_1, f_fnamemodify}, ! {"foldclosed", 1, 1, FEARG_1, f_foldclosed}, ! {"foldclosedend", 1, 1, FEARG_1, f_foldclosedend}, ! {"foldlevel", 1, 1, FEARG_1, f_foldlevel}, {"foldtext", 0, 0, 0, f_foldtext}, ! {"foldtextresult", 1, 1, FEARG_1, f_foldtextresult}, {"foreground", 0, 0, 0, f_foreground}, ! {"funcref", 1, 3, FEARG_1, f_funcref}, ! {"function", 1, 3, FEARG_1, f_function}, {"garbagecollect", 0, 1, 0, f_garbagecollect}, {"get", 2, 3, FEARG_1, f_get}, {"getbufinfo", 0, 1, 0, f_getbufinfo}, *** ../vim-8.1.1920/src/testdir/test_expand.vim 2019-06-09 17:21:48.657261063 +0200 --- src/testdir/test_expand.vim 2019-08-24 20:09:52.281481475 +0200 *************** *** 58,64 **** call assert_equal('e Xfile1', expandcmd('e %')) edit Xfile2 edit Xfile1 ! call assert_equal('e Xfile2', expandcmd('e #')) edit Xfile2 edit Xfile3 edit Xfile4 --- 58,64 ---- call assert_equal('e Xfile1', expandcmd('e %')) edit Xfile2 edit Xfile1 ! call assert_equal('e Xfile2', 'e #'->expandcmd()) edit Xfile2 edit Xfile3 edit Xfile4 *** ../vim-8.1.1920/src/testdir/test_expand_func.vim 2019-05-16 22:24:52.403017783 +0200 --- src/testdir/test_expand_func.vim 2019-08-24 20:06:51.974499005 +0200 *************** *** 68,74 **** func Test_expand() new call assert_equal("", expand('%:S')) ! call assert_equal('3', expand('')) call assert_equal(['4'], expand('', v:false, v:true)) " Don't add any line above this, otherwise will change. quit --- 68,74 ---- func Test_expand() new call assert_equal("", expand('%:S')) ! call assert_equal('3', ''->expand()) call assert_equal(['4'], expand('', v:false, v:true)) " Don't add any line above this, otherwise will change. quit *** ../vim-8.1.1920/src/testdir/test_expr.vim 2019-05-19 19:59:30.164255569 +0200 --- src/testdir/test_expr.vim 2019-08-24 20:43:37.687128199 +0200 *************** *** 403,409 **** call assert_equal(string(value), printf('%s', value)) " funcref ! call assert_equal('printf', printf('%s', function('printf'))) " partial call assert_equal(string(function('printf', ['%s'])), printf('%s', function('printf', ['%s']))) --- 403,409 ---- call assert_equal(string(value), printf('%s', value)) " funcref ! call assert_equal('printf', printf('%s', 'printf'->function())) " partial call assert_equal(string(function('printf', ['%s'])), printf('%s', function('printf', ['%s']))) *************** *** 490,496 **** endfunc call assert_equal(2, OneByName()) call assert_equal(1, OneByRef()) ! let OneByRef = funcref('One') call assert_equal(2, OneByRef()) call assert_fails('echo funcref("{")', 'E475:') endfunc --- 490,496 ---- endfunc call assert_equal(2, OneByName()) call assert_equal(1, OneByRef()) ! let OneByRef = 'One'->funcref() call assert_equal(2, OneByRef()) call assert_fails('echo funcref("{")', 'E475:') endfunc *** ../vim-8.1.1920/src/testdir/test_findfile.vim 2019-02-04 21:14:41.901108644 +0100 --- src/testdir/test_findfile.vim 2019-08-24 20:23:16.255612512 +0200 *************** *** 50,56 **** set path=. call assert_equal('Xdir2/foo', findfile('foo')) call assert_equal('', findfile('bar')) ! call assert_equal('Xdir2/foobar', findfile('foobar')) " Empty {path} 2nd argument is the same as no 2nd argument. call assert_equal('Xdir2/foo', findfile('foo', '')) --- 50,56 ---- set path=. call assert_equal('Xdir2/foo', findfile('foo')) call assert_equal('', findfile('bar')) ! call assert_equal('Xdir2/foobar', 'foobar'->findfile()) " Empty {path} 2nd argument is the same as no 2nd argument. call assert_equal('Xdir2/foo', findfile('foo', '')) *************** *** 137,143 **** cd Xdir1 call assert_equal('Xdir2', finddir('Xdir2')) ! call assert_equal('', finddir('Xdir3')) " Files should not be found (findfile() finds them). call assert_equal('', finddir('foo')) --- 137,143 ---- cd Xdir1 call assert_equal('Xdir2', finddir('Xdir2')) ! call assert_equal('', 'Xdir3'->finddir()) " Files should not be found (findfile() finds them). call assert_equal('', finddir('foo')) *** ../vim-8.1.1920/src/testdir/test_fnameescape.vim 2019-01-09 23:00:57.997176121 +0100 --- src/testdir/test_fnameescape.vim 2019-08-24 20:32:46.281811473 +0200 *************** *** 13,19 **** let fname = 'Xemark!' let status = v:false try ! exe "w! " . fnameescape(fname) let status = v:true endtry call assert_true(status, "ExclamationMark") --- 13,19 ---- let fname = 'Xemark!' let status = v:false try ! exe "w! " . fname->fnameescape() let status = v:true endtry call assert_true(status, "ExclamationMark") *** ../vim-8.1.1920/src/testdir/test_fnamemodify.vim 2019-05-16 22:24:52.407017760 +0200 --- src/testdir/test_fnamemodify.vim 2019-08-24 20:34:35.173390445 +0200 *************** *** 13,19 **** call assert_equal('a', fnamemodify('../testdir/a', ':.')) call assert_equal('~/testdir/test.out', fnamemodify('test.out', ':~')) call assert_equal('~/testdir/a', fnamemodify('../testdir/a', ':~')) ! call assert_equal('a', fnamemodify('../testdir/a', ':t')) call assert_equal('', fnamemodify('.', ':p:t')) call assert_equal('test.out', fnamemodify('test.out', ':p:t')) call assert_equal('out', fnamemodify('test.out', ':p:e')) --- 13,19 ---- call assert_equal('a', fnamemodify('../testdir/a', ':.')) call assert_equal('~/testdir/test.out', fnamemodify('test.out', ':~')) call assert_equal('~/testdir/a', fnamemodify('../testdir/a', ':~')) ! call assert_equal('a', '../testdir/a'->fnamemodify(':t')) call assert_equal('', fnamemodify('.', ':p:t')) call assert_equal('test.out', fnamemodify('test.out', ':p:t')) call assert_equal('out', fnamemodify('test.out', ':p:e')) *** ../vim-8.1.1920/src/testdir/test_fold.vim 2019-08-19 22:48:27.173038748 +0200 --- src/testdir/test_fold.vim 2019-08-24 20:38:02.752550657 +0200 *************** *** 89,95 **** setl fen fdm=marker 2 norm! >> ! let a=map(range(1,5), 'foldclosed(v:val)') call assert_equal([-1,-1,-1,4,4], a) bw! endfunc --- 89,95 ---- setl fen fdm=marker 2 norm! >> ! let a=map(range(1,5), 'v:val->foldclosed()') call assert_equal([-1,-1,-1,4,4], a) bw! endfunc *************** *** 133,139 **** call assert_equal(0, foldlevel(3)) call assert_equal(0, foldlevel(4)) call assert_equal(1, foldlevel(5)) ! call assert_equal(7, foldclosedend(5)) bwipe! set foldmethod& --- 133,139 ---- call assert_equal(0, foldlevel(3)) call assert_equal(0, foldlevel(4)) call assert_equal(1, foldlevel(5)) ! call assert_equal(7, 5->foldclosedend()) bwipe! set foldmethod& *************** *** 208,214 **** %foldclose call assert_equal(2, foldclosedend(1)) call assert_equal(0, foldlevel(3)) ! call assert_equal(0, foldlevel(4)) call assert_equal(6, foldclosedend(5)) call assert_equal(10, foldclosedend(7)) call assert_equal(14, foldclosedend(11)) --- 208,214 ---- %foldclose call assert_equal(2, foldclosedend(1)) call assert_equal(0, foldlevel(3)) ! call assert_equal(0, 4->foldlevel()) call assert_equal(6, foldclosedend(5)) call assert_equal(10, foldclosedend(7)) call assert_equal(14, foldclosedend(11)) *************** *** 656,662 **** call assert_equal(10, foldclosed(10)) call assert_equal(11, foldclosedend(10)) call assert_equal('+-- 2 lines: Line2', foldtextresult(2)) ! call assert_equal('+-- 2 lines: Line8', foldtextresult(10)) set fdm& sw& fdl& enew! --- 656,662 ---- call assert_equal(10, foldclosed(10)) call assert_equal(11, foldclosedend(10)) call assert_equal('+-- 2 lines: Line2', foldtextresult(2)) ! call assert_equal('+-- 2 lines: Line8', 10->foldtextresult()) set fdm& sw& fdl& enew! *** ../vim-8.1.1920/src/testdir/test_functions.vim 2019-08-23 22:31:33.213176889 +0200 --- src/testdir/test_functions.vim 2019-08-24 20:20:33.895911175 +0200 *************** *** 1001,1007 **** call assert_equal(0, filewritable('Xfilewritable')) call assert_notequal(0, setfperm('Xfilewritable', 'rw-r-----')) ! call assert_equal(1, filewritable('Xfilewritable')) call assert_equal(0, filewritable('doesnotexist')) --- 1001,1007 ---- call assert_equal(0, filewritable('Xfilewritable')) call assert_notequal(0, setfperm('Xfilewritable', 'rw-r-----')) ! call assert_equal(1, 'Xfilewritable'->filewritable()) call assert_equal(0, filewritable('doesnotexist')) *************** *** 1012,1031 **** func Test_Executable() if has('win32') call assert_equal(1, executable('notepad')) ! call assert_equal(1, executable('notepad.exe')) call assert_equal(0, executable('notepad.exe.exe')) call assert_equal(0, executable('shell32.dll')) call assert_equal(0, executable('win.ini')) elseif has('unix') ! call assert_equal(1, executable('cat')) call assert_equal(0, executable('nodogshere')) " get "cat" path and remove the leading / let catcmd = exepath('cat')[1:] new lcd / call assert_equal(1, executable(catcmd)) ! call assert_equal('/' .. catcmd, exepath(catcmd)) bwipe endif endfunc --- 1012,1032 ---- func Test_Executable() if has('win32') call assert_equal(1, executable('notepad')) ! call assert_equal(1, 'notepad.exe'->executable()) call assert_equal(0, executable('notepad.exe.exe')) call assert_equal(0, executable('shell32.dll')) call assert_equal(0, executable('win.ini')) elseif has('unix') ! call assert_equal(1, 'cat'->executable()) call assert_equal(0, executable('nodogshere')) " get "cat" path and remove the leading / let catcmd = exepath('cat')[1:] new + " check that the relative path works in / lcd / call assert_equal(1, executable(catcmd)) ! call assert_equal('/' .. catcmd, catcmd->exepath()) bwipe endif endfunc *************** *** 1349,1355 **** sandbox let F = {-> 'hello'} call assert_equal('hello', F()) ! sandbox let F = {-> execute("normal ix\")} call assert_fails('call F()', 'E48:') unlet F --- 1350,1356 ---- sandbox let F = {-> 'hello'} call assert_equal('hello', F()) ! sandbox let F = {-> "normal ix\"->execute()} call assert_fails('call F()', 'E48:') unlet F *************** *** 1380,1386 **** call writefile(['func ExistingFunction()', 'echo "yes"', 'endfunc'], 'Xfuncexists') call assert_equal(0, exists('*ExistingFunction')) source Xfuncexists ! call assert_equal(1, exists('*ExistingFunction')) " Redefining a function when reloading a script is OK. source Xfuncexists call assert_equal(1, exists('*ExistingFunction')) --- 1381,1387 ---- call writefile(['func ExistingFunction()', 'echo "yes"', 'endfunc'], 'Xfuncexists') call assert_equal(0, exists('*ExistingFunction')) source Xfuncexists ! call assert_equal(1, '*ExistingFunction'->exists()) " Redefining a function when reloading a script is OK. source Xfuncexists call assert_equal(1, exists('*ExistingFunction')) *************** *** 1427,1433 **** " requires another character to avoid it being seen as the start of an " escape sequence. Zero should be harmless. ! call feedkeys("\0", 'L') let a = confirm('Are you sure?', "&Yes\n&No") call assert_equal(0, a) --- 1428,1434 ---- " requires another character to avoid it being seen as the start of an " escape sequence. Zero should be harmless. ! eval "\0"->feedkeys('L') let a = confirm('Are you sure?', "&Yes\n&No") call assert_equal(0, a) *************** *** 1525,1531 **** call writefile([], 'Xdir/[a-1]/foo.txt') call writefile([], 'Xdir/[a-1]/bar.txt') call assert_true(filereadable('Xdir/foo.txt')) ! call assert_true(filereadable('Xdir/[a-1]/foo.txt')) call assert_equal(0, delete('Xdir', 'rf')) call assert_false(filereadable('Xdir/foo.txt')) --- 1526,1532 ---- call writefile([], 'Xdir/[a-1]/foo.txt') call writefile([], 'Xdir/[a-1]/bar.txt') call assert_true(filereadable('Xdir/foo.txt')) ! call assert_true('Xdir/[a-1]/foo.txt'->filereadable()) call assert_equal(0, delete('Xdir', 'rf')) call assert_false(filereadable('Xdir/foo.txt')) *** ../vim-8.1.1920/src/testdir/test_search.vim 2019-08-07 23:07:03.960858821 +0200 --- src/testdir/test_search.vim 2019-08-24 19:48:12.072442291 +0200 *************** *** 1303,1309 **** call cursor(1, 1) let @/ = 'foo' ! let pat = escape(@/, '()*?'. '\s\+') let g:a = execute(':unsilent :norm! n') call assert_match(pat, g:a) --- 1303,1309 ---- call cursor(1, 1) let @/ = 'foo' ! let pat = @/->escape('()*?'. '\s\+') let g:a = execute(':unsilent :norm! n') call assert_match(pat, g:a) *** ../vim-8.1.1920/src/testdir/test_vimscript.vim 2019-08-18 23:01:33.725885954 +0200 --- src/testdir/test_vimscript.vim 2019-08-24 19:46:40.208861160 +0200 *************** *** 638,644 **** if v:errmsg == "" Xout "Message missing." else ! let v:errmsg = escape(v:errmsg, '"') Xout "Unexpected message:" v:errmsg endif endif --- 638,644 ---- if v:errmsg == "" Xout "Message missing." else ! let v:errmsg = v:errmsg->escape('"') Xout "Unexpected message:" v:errmsg endif endif *** ../vim-8.1.1920/src/version.c 2019-08-24 18:23:06.423390821 +0200 --- src/version.c 2019-08-24 20:49:02.673661692 +0200 *************** *** 763,764 **** --- 763,766 ---- { /* Add new patch number below this line */ + /**/ + 1921, /**/ -- Corduroy pillows: They're making headlines! /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///