To: vim_dev@googlegroups.com Subject: Patch 8.1.2004 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2004 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_breakindent.vim, src/testdir/test_expr.vim, src/testdir/test_functions.vim, src/testdir/test_sound.vim, src/testdir/test_spell.vim, src/testdir/test_substitute.vim, src/testdir/test_swap.vim, src/testdir/test_utf8.vim *** ../vim-8.1.2003/runtime/doc/eval.txt 2019-09-07 15:07:49.527268367 +0200 --- runtime/doc/eval.txt 2019-09-07 18:18:46.387884064 +0200 *************** *** 8881,8887 **** Returns the sound ID, which can be passed to `sound_stop()`. Returns zero if the sound could not be played. ! {only available when compiled with the |+sound| feature} *sound_playfile()* sound_playfile({path} [, {callback}]) --- 8895,8905 ---- Returns the sound ID, which can be passed to `sound_stop()`. Returns zero if the sound could not be played. ! ! Can also be used as a |method|: > ! GetSoundName()->sound_playevent() ! ! < {only available when compiled with the |+sound| feature} *sound_playfile()* sound_playfile({path} [, {callback}]) *************** *** 8889,8894 **** --- 8907,8916 ---- must be a full path. On Ubuntu you may find files to play with this command: > :!find /usr/share/sounds -type f | grep -v index.theme + + < Can also be used as a |method|: > + GetSoundPath()->sound_playfile() + < {only available when compiled with the |+sound| feature} *************** *** 8899,8905 **** On MS-Windows, this does not work for event sound started by `sound_playevent()`. To stop event sounds, use `sound_clear()`. ! {only available when compiled with the |+sound| feature} *soundfold()* soundfold({word}) --- 8921,8930 ---- On MS-Windows, this does not work for event sound started by `sound_playevent()`. To stop event sounds, use `sound_clear()`. ! Can also be used as a |method|: > ! soundid->sound_stop() ! ! < {only available when compiled with the |+sound| feature} *soundfold()* soundfold({word}) *************** *** 8910,8915 **** --- 8935,8943 ---- This can be used for making spelling suggestions. Note that the method can be quite slow. + Can also be used as a |method|: > + GetWord()->soundfold() + < *spellbadword()* spellbadword([{sentence}]) Without argument: The result is the badly spelled word under *************** *** 8936,8941 **** --- 8964,8972 ---- 'spell' option must be set and the value of 'spelllang' is used. + Can also be used as a |method|: > + GetText()->spellbadword() + < *spellsuggest()* spellsuggest({word} [, {max} [, {capital}]]) Return a |List| with spelling suggestions to replace {word}. *************** *** 8959,8964 **** --- 8990,8997 ---- 'spell' option must be set and the values of 'spelllang' and 'spellsuggest' are used. + Can also be used as a |method|: > + GetWord()->spellsuggest() split({expr} [, {pattern} [, {keepempty}]]) *split()* Make a |List| out of {expr}. When {pattern} is omitted or *************** *** 9055,9060 **** --- 9088,9106 ---- leading "0b" or "0B" is ignored. Text after the number is silently ignored. + Can also be used as a |method|: > + GetText()->str2nr() + + strcharpart({src}, {start} [, {len}]) *strcharpart()* + Like |strpart()| but using character index and length instead + of byte index and length. + When a character index is used where a character does not + exist it is assumed to be one character. For example: > + strcharpart('abc', -1, 2) + < results in 'a'. + + Can also be used as a |method|: > + GetText()->strcharpart(5) strchars({expr} [, {skipcc}]) *strchars()* The result is a Number, which is the number of characters *************** *** 9080,9092 **** endfunction endif < ! strcharpart({src}, {start} [, {len}]) *strcharpart()* ! Like |strpart()| but using character index and length instead ! of byte index and length. ! When a character index is used where a character does not ! exist it is assumed to be one character. For example: > ! strcharpart('abc', -1, 2) ! < results in 'a'. strdisplaywidth({expr} [, {col}]) *strdisplaywidth()* The result is a Number, which is the number of display cells --- 9126,9133 ---- endfunction endif < ! Can also be used as a |method|: > ! GetText()->strchars() strdisplaywidth({expr} [, {col}]) *strdisplaywidth()* The result is a Number, which is the number of display cells *************** *** 9101,9106 **** --- 9142,9150 ---- Ambiguous, this function's return value depends on 'ambiwidth'. Also see |strlen()|, |strwidth()| and |strchars()|. + Can also be used as a |method|: > + GetText()->strdisplaywidth() + strftime({format} [, {time}]) *strftime()* The result is a String, which is a formatted date and time, as specified by the {format} string. The given {time} is used, *************** *** 9120,9131 **** --- 9164,9181 ---- < Not available on all systems. To check use: > :if exists("*strftime") + < Can also be used as a |method|: > + GetFormat()->strftime() + strgetchar({str}, {index}) *strgetchar()* Get character {index} from {str}. This uses a character index, not a byte index. Composing characters are considered separate characters here. Also see |strcharpart()| and |strchars()|. + Can also be used as a |method|: > + GetText()->strgetchar(5) + stridx({haystack}, {needle} [, {start}]) *stridx()* The result is a Number, which gives the byte index in {haystack} of the first occurrence of the String {needle}. *************** *** 9145,9150 **** --- 9195,9202 ---- stridx() works similar to the C function strstr(). When used with a single character it works similar to strchr(). + Can also be used as a |method|: > + GetHaystack()->stridx(needle) *string()* string({expr}) Return {expr} converted to a String. If {expr} is a Number, Float, String, Blob or a composition of them, then the result *************** *** 9197,9202 **** --- 9249,9257 ---- example, to get three bytes under and after the cursor: > strpart(getline("."), col(".") - 1, 3) < + Can also be used as a |method|: > + GetText()->strpart(5) + strridx({haystack}, {needle} [, {start}]) *strridx()* The result is a Number, which gives the byte index in {haystack} of the last occurrence of the String {needle}. *************** *** 9215,9220 **** --- 9270,9278 ---- When used with a single character it works similar to the C function strrchr(). + Can also be used as a |method|: > + GetHaystack()->strridx(needle) + strtrans({expr}) *strtrans()* The result is a String, which is {expr} with all unprintable characters translated into printable characters |'isprint'|. *************** *** 9263,9268 **** --- 9321,9329 ---- < This finds the first number in the line and adds one to it. A line break is included as a newline character. + Can also be used as a |method|: > + GetNr()->submatch() + substitute({expr}, {pat}, {sub}, {flags}) *substitute()* The result is a String, which is a copy of {expr}, in which the first match of {pat} is replaced with {sub}. *************** *** 9326,9331 **** --- 9387,9395 ---- Not a swap file: does not contain correct block ID Magic number mismatch: Info in first block is invalid + Can also be used as a |method|: > + GetFilename()->swapinfo() + swapname({expr}) *swapname()* The result is the swap file path of the buffer {expr}. For the use of {expr}, see |bufname()| above. *************** *** 9333,9338 **** --- 9397,9405 ---- |:swapname| (unless no swap file). If buffer {expr} has no swap file, returns an empty string. + Can also be used as a |method|: > + GetBufname()->swapname() + synID({lnum}, {col}, {trans}) *synID()* The result is a Number, which is the syntax ID at the position {lnum} and {col} in the current window. *** ../vim-8.1.2003/src/evalfunc.c 2019-09-07 15:45:09.977228927 +0200 --- src/evalfunc.c 2019-09-07 18:18:51.767862583 +0200 *************** *** 715,752 **** {"sort", 1, 3, FEARG_1, f_sort}, #ifdef FEAT_SOUND {"sound_clear", 0, 0, 0, f_sound_clear}, ! {"sound_playevent", 1, 2, 0, f_sound_playevent}, ! {"sound_playfile", 1, 2, 0, f_sound_playfile}, ! {"sound_stop", 1, 1, 0, f_sound_stop}, #endif ! {"soundfold", 1, 1, 0, f_soundfold}, ! {"spellbadword", 0, 1, 0, f_spellbadword}, ! {"spellsuggest", 1, 3, 0, f_spellsuggest}, {"split", 1, 3, FEARG_1, f_split}, #ifdef FEAT_FLOAT {"sqrt", 1, 1, FEARG_1, f_sqrt}, {"str2float", 1, 1, FEARG_1, f_str2float}, #endif {"str2list", 1, 2, FEARG_1, f_str2list}, ! {"str2nr", 1, 2, 0, f_str2nr}, ! {"strcharpart", 2, 3, 0, f_strcharpart}, ! {"strchars", 1, 2, 0, f_strchars}, ! {"strdisplaywidth", 1, 2, 0, f_strdisplaywidth}, #ifdef HAVE_STRFTIME ! {"strftime", 1, 2, 0, f_strftime}, #endif ! {"strgetchar", 2, 2, 0, f_strgetchar}, ! {"stridx", 2, 3, 0, f_stridx}, {"string", 1, 1, FEARG_1, f_string}, {"strlen", 1, 1, FEARG_1, f_strlen}, ! {"strpart", 2, 3, 0, f_strpart}, ! {"strridx", 2, 3, 0, f_strridx}, {"strtrans", 1, 1, FEARG_1, f_strtrans}, {"strwidth", 1, 1, FEARG_1, f_strwidth}, ! {"submatch", 1, 2, 0, f_submatch}, {"substitute", 4, 4, FEARG_1, f_substitute}, ! {"swapinfo", 1, 1, 0, f_swapinfo}, ! {"swapname", 1, 1, 0, f_swapname}, {"synID", 3, 3, 0, f_synID}, {"synIDattr", 2, 3, FEARG_1, f_synIDattr}, {"synIDtrans", 1, 1, FEARG_1, f_synIDtrans}, --- 715,752 ---- {"sort", 1, 3, FEARG_1, f_sort}, #ifdef FEAT_SOUND {"sound_clear", 0, 0, 0, f_sound_clear}, ! {"sound_playevent", 1, 2, FEARG_1, f_sound_playevent}, ! {"sound_playfile", 1, 2, FEARG_1, f_sound_playfile}, ! {"sound_stop", 1, 1, FEARG_1, f_sound_stop}, #endif ! {"soundfold", 1, 1, FEARG_1, f_soundfold}, ! {"spellbadword", 0, 1, FEARG_1, f_spellbadword}, ! {"spellsuggest", 1, 3, FEARG_1, f_spellsuggest}, {"split", 1, 3, FEARG_1, f_split}, #ifdef FEAT_FLOAT {"sqrt", 1, 1, FEARG_1, f_sqrt}, {"str2float", 1, 1, FEARG_1, f_str2float}, #endif {"str2list", 1, 2, FEARG_1, f_str2list}, ! {"str2nr", 1, 2, FEARG_1, f_str2nr}, ! {"strcharpart", 2, 3, FEARG_1, f_strcharpart}, ! {"strchars", 1, 2, FEARG_1, f_strchars}, ! {"strdisplaywidth", 1, 2, FEARG_1, f_strdisplaywidth}, #ifdef HAVE_STRFTIME ! {"strftime", 1, 2, FEARG_1, f_strftime}, #endif ! {"strgetchar", 2, 2, FEARG_1, f_strgetchar}, ! {"stridx", 2, 3, FEARG_1, f_stridx}, {"string", 1, 1, FEARG_1, f_string}, {"strlen", 1, 1, FEARG_1, f_strlen}, ! {"strpart", 2, 3, FEARG_1, f_strpart}, ! {"strridx", 2, 3, FEARG_1, f_strridx}, {"strtrans", 1, 1, FEARG_1, f_strtrans}, {"strwidth", 1, 1, FEARG_1, f_strwidth}, ! {"submatch", 1, 2, FEARG_1, f_submatch}, {"substitute", 4, 4, FEARG_1, f_substitute}, ! {"swapinfo", 1, 1, FEARG_1, f_swapinfo}, ! {"swapname", 1, 1, FEARG_1, f_swapname}, {"synID", 3, 3, 0, f_synID}, {"synIDattr", 2, 3, FEARG_1, f_synIDattr}, {"synIDtrans", 1, 1, FEARG_1, f_synIDtrans}, *** ../vim-8.1.2003/src/testdir/test_breakindent.vim 2019-08-31 21:17:35.594131454 +0200 --- src/testdir/test_breakindent.vim 2019-09-07 17:54:17.836158322 +0200 *************** *** 424,430 **** call s:test_windows('setl cpo-=n sbr=>> nu nuw=4 nolist briopt= ts=4 vts=4') let text = getline(2) let width = strlen(text[1:]) + 2->indent() + strlen(&sbr) * 3 " text wraps 3 times ! call assert_equal(width, strdisplaywidth(text)) call s:close_windows('set sbr= vts&') endfunc --- 424,430 ---- call s:test_windows('setl cpo-=n sbr=>> nu nuw=4 nolist briopt= ts=4 vts=4') let text = getline(2) let width = strlen(text[1:]) + 2->indent() + strlen(&sbr) * 3 " text wraps 3 times ! call assert_equal(width, text->strdisplaywidth()) call s:close_windows('set sbr= vts&') endfunc *** ../vim-8.1.2003/src/testdir/test_expr.vim 2019-09-06 22:45:47.574271573 +0200 --- src/testdir/test_expr.vim 2019-09-07 18:02:58.848284662 +0200 *************** *** 53,59 **** func Test_strgetchar() call assert_equal(char2nr('a'), strgetchar('axb', 0)) ! call assert_equal(char2nr('x'), strgetchar('axb', 1)) call assert_equal(char2nr('b'), strgetchar('axb', 2)) call assert_equal(-1, strgetchar('axb', -1)) --- 53,59 ---- func Test_strgetchar() call assert_equal(char2nr('a'), strgetchar('axb', 0)) ! call assert_equal(char2nr('x'), 'axb'->strgetchar(1)) call assert_equal(char2nr('b'), strgetchar('axb', 2)) call assert_equal(-1, strgetchar('axb', -1)) *************** *** 63,69 **** func Test_strcharpart() call assert_equal('a', strcharpart('axb', 0, 1)) ! call assert_equal('x', strcharpart('axb', 1, 1)) call assert_equal('b', strcharpart('axb', 2, 1)) call assert_equal('xb', strcharpart('axb', 1)) --- 63,69 ---- func Test_strcharpart() call assert_equal('a', strcharpart('axb', 0, 1)) ! call assert_equal('x', 'axb'->strcharpart(1, 1)) call assert_equal('b', strcharpart('axb', 2, 1)) call assert_equal('xb', strcharpart('axb', 1)) *** ../vim-8.1.2003/src/testdir/test_functions.vim 2019-09-06 22:45:47.578271556 +0200 --- src/testdir/test_functions.vim 2019-09-07 18:12:12.421526032 +0200 *************** *** 138,144 **** call assert_equal(-123456789, str2nr('-123456789')) call assert_equal(5, str2nr('101', 2)) ! call assert_equal(5, str2nr('0b101', 2)) call assert_equal(5, str2nr('0B101', 2)) call assert_equal(-5, str2nr('-101', 2)) call assert_equal(-5, str2nr('-0b101', 2)) --- 138,144 ---- call assert_equal(-123456789, str2nr('-123456789')) call assert_equal(5, str2nr('101', 2)) ! call assert_equal(5, '0b101'->str2nr(2)) call assert_equal(5, str2nr('0B101', 2)) call assert_equal(-5, str2nr('-101', 2)) call assert_equal(-5, str2nr('-0b101', 2)) *************** *** 184,190 **** " of strftime() can be 17 or 18, depending on timezone. call assert_match('^2017-01-1[78]$', strftime('%Y-%m-%d', 1484695512)) " ! call assert_match('^\d\d\d\d-\(0\d\|1[012]\)-\([012]\d\|3[01]\) \([01]\d\|2[0-3]\):[0-5]\d:\([0-5]\d\|60\)$', strftime('%Y-%m-%d %H:%M:%S')) call assert_fails('call strftime([])', 'E730:') call assert_fails('call strftime("%Y", [])', 'E745:') --- 184,190 ---- " of strftime() can be 17 or 18, depending on timezone. call assert_match('^2017-01-1[78]$', strftime('%Y-%m-%d', 1484695512)) " ! call assert_match('^\d\d\d\d-\(0\d\|1[012]\)-\([012]\d\|3[01]\) \([01]\d\|2[0-3]\):[0-5]\d:\([0-5]\d\|60\)$', '%Y-%m-%d %H:%M:%S'->strftime()) call assert_fails('call strftime([])', 'E730:') call assert_fails('call strftime("%Y", [])', 'E745:') *************** *** 415,421 **** func Test_strpart() call assert_equal('de', strpart('abcdefg', 3, 2)) call assert_equal('ab', strpart('abcdefg', -2, 4)) ! call assert_equal('abcdefg', strpart('abcdefg', -2)) call assert_equal('fg', strpart('abcdefg', 5, 4)) call assert_equal('defg', strpart('abcdefg', 3)) --- 415,421 ---- func Test_strpart() call assert_equal('de', strpart('abcdefg', 3, 2)) call assert_equal('ab', strpart('abcdefg', -2, 4)) ! call assert_equal('abcdefg', 'abcdefg'->strpart(-2)) call assert_equal('fg', strpart('abcdefg', 5, 4)) call assert_equal('defg', strpart('abcdefg', 3)) *************** *** 763,773 **** func Test_stridx() call assert_equal(-1, stridx('', 'l')) call assert_equal(0, stridx('', '')) ! call assert_equal(0, stridx('hello', '')) call assert_equal(-1, stridx('hello', 'L')) call assert_equal(2, stridx('hello', 'l', -1)) call assert_equal(2, stridx('hello', 'l', 0)) ! call assert_equal(2, stridx('hello', 'l', 1)) call assert_equal(3, stridx('hello', 'l', 3)) call assert_equal(-1, stridx('hello', 'l', 4)) call assert_equal(-1, stridx('hello', 'l', 10)) --- 763,773 ---- func Test_stridx() call assert_equal(-1, stridx('', 'l')) call assert_equal(0, stridx('', '')) ! call assert_equal(0, 'hello'->stridx('')) call assert_equal(-1, stridx('hello', 'L')) call assert_equal(2, stridx('hello', 'l', -1)) call assert_equal(2, stridx('hello', 'l', 0)) ! call assert_equal(2, 'hello'->stridx('l', 1)) call assert_equal(3, stridx('hello', 'l', 3)) call assert_equal(-1, stridx('hello', 'l', 4)) call assert_equal(-1, stridx('hello', 'l', 10)) *************** *** 780,786 **** call assert_equal(0, strridx('', '')) call assert_equal(5, strridx('hello', '')) call assert_equal(-1, strridx('hello', 'L')) ! call assert_equal(3, strridx('hello', 'l')) call assert_equal(3, strridx('hello', 'l', 10)) call assert_equal(3, strridx('hello', 'l', 3)) call assert_equal(2, strridx('hello', 'l', 2)) --- 780,786 ---- call assert_equal(0, strridx('', '')) call assert_equal(5, strridx('hello', '')) call assert_equal(-1, strridx('hello', 'L')) ! call assert_equal(3, 'hello'->strridx('l')) call assert_equal(3, strridx('hello', 'l', 10)) call assert_equal(3, strridx('hello', 'l', 3)) call assert_equal(2, strridx('hello', 'l', 2)) *** ../vim-8.1.2003/src/testdir/test_sound.vim 2019-08-15 23:05:46.042376801 +0200 --- src/testdir/test_sound.vim 2019-09-07 17:38:42.012467287 +0200 *************** *** 13,25 **** if has('win32') throw 'Skipped: Playing event with callback is not supported on Windows' endif ! let id = sound_playevent('bell', 'PlayCallback') if id == 0 throw 'Skipped: bell event not available' endif " Stop it quickly, avoid annoying the user. sleep 20m ! call sound_stop(id) sleep 30m call assert_equal(id, g:id) call assert_equal(1, g:result) " sound was aborted --- 13,25 ---- if has('win32') throw 'Skipped: Playing event with callback is not supported on Windows' endif ! let id = 'bell'->sound_playevent('PlayCallback') if id == 0 throw 'Skipped: bell event not available' endif " Stop it quickly, avoid annoying the user. sleep 20m ! eval id->sound_stop() sleep 30m call assert_equal(id, g:id) call assert_equal(1, g:result) " sound was aborted *************** *** 35,41 **** endif " play until the end ! let id2 = sound_playfile(fname, 'PlayCallback') call assert_true(id2 > 0) sleep 500m call assert_equal(id2, g:id) --- 35,41 ---- endif " play until the end ! let id2 = fname->sound_playfile('PlayCallback') call assert_true(id2 > 0) sleep 500m call assert_equal(id2, g:id) *** ../vim-8.1.2003/src/testdir/test_spell.vim 2019-08-06 22:47:57.108635796 +0200 --- src/testdir/test_spell.vim 2019-09-07 17:41:38.416101873 +0200 *************** *** 73,79 **** set spell call assert_equal(['bycycle', 'bad'], spellbadword('My bycycle.')) ! call assert_equal(['another', 'caps'], spellbadword('A sentence. another sentence')) set spelllang=en call assert_equal(['', ''], spellbadword('centre')) --- 73,79 ---- set spell call assert_equal(['bycycle', 'bad'], spellbadword('My bycycle.')) ! call assert_equal(['another', 'caps'], 'A sentence. another sentence'->spellbadword()) set spelllang=en call assert_equal(['', ''], spellbadword('centre')) *************** *** 179,185 **** \ ) call assert_equal("gebletegek", soundfold('goobledygoook')) ! call assert_equal("kepereneven", soundfold('kóopërÿnôven')) call assert_equal("everles gesvets etele", soundfold('oeverloos gezwets edale')) endfunc --- 179,185 ---- \ ) call assert_equal("gebletegek", soundfold('goobledygoook')) ! call assert_equal("kepereneven", 'kóopërÿnôven'->soundfold()) call assert_equal("everles gesvets etele", soundfold('oeverloos gezwets edale')) endfunc *************** *** 440,446 **** break endif let prevbad = bad ! let lst = spellsuggest(bad, 3) normal mm call add(result, [bad, lst]) --- 440,446 ---- break endif let prevbad = bad ! let lst = bad->spellsuggest(3) normal mm call add(result, [bad, lst]) *** ../vim-8.1.2003/src/testdir/test_substitute.vim 2019-08-31 17:48:16.725154231 +0200 --- src/testdir/test_substitute.vim 2019-09-07 18:17:29.212194492 +0200 *************** *** 337,343 **** \ substitute('A123456789', \ 'A\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)', \ '\=string([submatch(0, 1), submatch(9, 1), ' . ! \ 'submatch(8, 1), submatch(7, 1), submatch(6, 1), ' . \ 'submatch(5, 1), submatch(4, 1), submatch(3, 1), ' . \ 'submatch(2, 1), submatch(1, 1)])', \ '')) --- 337,343 ---- \ substitute('A123456789', \ 'A\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)\(.\)', \ '\=string([submatch(0, 1), submatch(9, 1), ' . ! \ 'submatch(8, 1), 7->submatch(1), submatch(6, 1), ' . \ 'submatch(5, 1), submatch(4, 1), submatch(3, 1), ' . \ 'submatch(2, 1), submatch(1, 1)])', \ '')) *** ../vim-8.1.2003/src/testdir/test_swap.vim 2019-05-23 21:35:44.459922615 +0200 --- src/testdir/test_swap.vim 2019-09-07 18:19:18.423756431 +0200 *************** *** 111,117 **** w let fname = s:swapname() call assert_match('Xswapinfo', fname) ! let info = swapinfo(fname) let ver = printf('VIM %d.%d', v:version / 100, v:version % 100) call assert_equal(ver, info.version) --- 111,117 ---- w let fname = s:swapname() call assert_match('Xswapinfo', fname) ! let info = fname->swapinfo() let ver = printf('VIM %d.%d', v:version / 100, v:version % 100) call assert_equal(ver, info.version) *************** *** 153,159 **** let buf = bufnr('%') let expected = s:swapname() wincmd p ! call assert_equal(expected, swapname(buf)) new Xtest3 setlocal noswapfile --- 153,159 ---- let buf = bufnr('%') let expected = s:swapname() wincmd p ! call assert_equal(expected, buf->swapname()) new Xtest3 setlocal noswapfile *** ../vim-8.1.2003/src/testdir/test_utf8.vim 2019-09-06 21:34:25.362847408 +0200 --- src/testdir/test_utf8.vim 2019-09-07 17:51:59.921616596 +0200 *************** *** 17,23 **** let exp = [[1, 1, 1], [3, 3, 3], [2, 2, 1], [3, 3, 1], [1, 1, 1]] for i in range(len(inp)) call assert_equal(exp[i][0], strchars(inp[i])) ! call assert_equal(exp[i][1], strchars(inp[i], 0)) call assert_equal(exp[i][2], strchars(inp[i], 1)) endfor endfunc --- 17,23 ---- let exp = [[1, 1, 1], [3, 3, 3], [2, 2, 1], [3, 3, 1], [1, 1, 1]] for i in range(len(inp)) call assert_equal(exp[i][0], strchars(inp[i])) ! call assert_equal(exp[i][1], inp[i]->strchars(0)) call assert_equal(exp[i][2], strchars(inp[i], 1)) endfor endfunc *** ../vim-8.1.2003/src/version.c 2019-09-07 16:07:43.961413385 +0200 --- src/version.c 2019-09-07 19:04:27.473452999 +0200 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 2004, /**/ -- hundred-and-one symptoms of being an internet addict: 210. When you get a divorce, you don't care about who gets the children, but discuss endlessly who can use the email address. /// 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 ///