Re: Bug of vim script

2019-09-15 Thread Tony Mechelynck
On Sun, Sep 15, 2019 at 8:55 AM Shidong Wang wrote: > > Hello, I am not sure if it is a bug, but it always make me confuses: > > here is a exmaple: > > func Test() > let c = 'sss' > let a = 1 > let b = 2 > echo c[a:b] > endf > > then call Test(), you will get error, Undefined variable: a:b

Bug of vim script

2019-09-15 Thread John Little
a: is a scope, like g: or s:, for arguments of the function. For example: function WithArgs(first, second) echo a:first a:second echo a:1 a:2 endfunction Regards, John Little -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text y

Re: Bug of vim script

2019-09-15 Thread Tony Mechelynck
Gotcha! In a function, a:b means "the argument named b". However, c[a:b] is an error even outside a function. c[a:b] is an error because a: is a known namespace (function arguments) c[b,d] is an error because b is a known namespace (buffer variables) c[x:y] is not an error, even with no spaces. B

Patch 8.1.2034

2019-09-15 Thread Bram Moolenaar
Patch 8.1.2034 Problem:Dark theme of GTK 3 not supported. Solution: Add the "d" flag in 'guioptions'. (Jonathan Conder, closes #4934) Files: runtime/doc/options.txt, src/feature.h, src/gui.c, src/gui_gtk_x11.c, src/option.h, src/proto/gui_gtk_x11.pro, src/testdi

Patch 8.1.2035

2019-09-15 Thread Bram Moolenaar
Patch 8.1.2035 Problem:Recognizing octal numbers is confusing. Solution: Introduce scriptversion 4: do not use octal and allow for single quote inside numbers. Files: runtime/doc/eval.txt, src/vim.h, src/eval.c, src/scriptfile.c, src/evalfunc.c, src/testdir/test

Patch 8.1.2036

2019-09-15 Thread Bram Moolenaar
Patch 8.1.2036 (after 8.1.2035) Problem:The str2nr() tests fail. Solution: Add missing part of patch. Files: src/charset.c *** ../vim-8.1.2035/src/charset.c 2019-08-21 14:36:29.383376114 +0200 --- src/charset.c 2019-09-15 14:25:33.242229716 +0200 *** *** 1773,

Regression using "-d" after 2027

2019-09-15 Thread 'Aaron Heifetz' via vim_dev
After making 8.1.2033 (Windows 7, 64-bit MinGW) the display for the internal diff (external diff not tested) seems to be broken (8.1.2027 was ok): 8.1.2027: [image: gvim8.1.2027.png] 8.1.2033 (mind the missing diff colors): [image: gvim8.1.2034.png] In the latter build, the internal dif

Re: Channel based plugins and scheduling

2019-09-15 Thread Paul Jolly
Hi Bram, Thanks for taking the time to put together the proposal. > Add a safeState() function, which returns true when: > - not halfway a mapping or stuffed command > - no operator pending > - not executing autocommand > - no autocomplete active perhaps? > - not blocked on waiting, e.g. ch_evale

Patch 8.1.2037

2019-09-15 Thread Bram Moolenaar
Patch 8.1.2037 Problem:Can call win_gotoid() in cmdline window. Solution: Disallow switching windows. (Yasuhiro Matsumoto, closes #4940) Files: src/evalwindow.c, src/testdir/test_cmdline.vim *** ../vim-8.1.2036/src/evalwindow.c2019-09-10 21:22:54.876629189 +0200 --- src/evalwindo

Re: Regression using "-d" after 2027

2019-09-15 Thread Bram Moolenaar
Aaron Heifetz wrote: > After making 8.1.2033 (Windows 7, 64-bit MinGW) the display for the > internal diff (external diff not tested) seems to be broken (8.1.2027 was > ok): > > 8.1.2027: > > > [image: gvim8.1.2027.png] > > > 8.1.2033 (mind the missing diff colors): > > > [image: gvim8.

Re: Channel based plugins and scheduling

2019-09-15 Thread Bram Moolenaar
Paul Jolly wrote: > Thanks for taking the time to put together the proposal. > > > Add a safeState() function, which returns true when: > > - not halfway a mapping or stuffed command > > - no operator pending > > - not executing autocommand > > - no autocomplete active perhaps? > > - not blocke

Patch 8.1.2038

2019-09-15 Thread Bram Moolenaar
Patch 8.1.2038 Problem:has('vimscript-4') is always 0. Solution: Add "vimscript-4" to the feature table. (Naruhiko Nishino, closes #4941) Files: src/evalfunc.c, src/testdir/test_eval_stuff.vim *** ../vim-8.1.2037/src/evalfunc.c 2019-09-15 14:32:49.556731456 +0200 ---

Re: Regression using "-d" after 2027

2019-09-15 Thread 'Aaron Heifetz' via vim_dev
a) Haven't changed my .vimrc between the specified versions: if has("patch-8.1.360") set diffopt=internal,filler,context:3,indent-heuristic,algorithm:minimal else ... endif b) No difference in :scriptnames output. c) :set all: --- Options --- ambiwidth=singleclipboard=nodiff

Patch 8.1.2039

2019-09-15 Thread Bram Moolenaar
Patch 8.1.2039 Problem:Character from 'showbreak' does not use 'wincolor'. (Nick Jensen) Solution: Mix with 'wincolor'. (closes #4938) Files: src/screen.c, src/testdir/test_popupwin.vim, src/testdir/dumps/Test_popupwin_showbreak.dump *** ../vim-8.1.2038/src/screen.c

Re: Regression using "-d" after 2027

2019-09-15 Thread Bram Moolenaar
Aaron Heifetz wrote: > a) Haven't changed my .vimrc between the specified versions: > > if has("patch-8.1.360") > set diffopt=3Dinternal,filler,context:3,indent-heuristic,algorithm:mini= > mal > else > ... > endif > > b) No difference in :scriptnames output. Not what changed, but what you

Patch 8.1.2040

2019-09-15 Thread Bram Moolenaar
Patch 8.1.2040 Problem:No highlighting of current line in quickfix window. Solution: Combine with line_attr. Files: src/screen.c, src/testdir/test_quickfix.vim, src/testdir/dumps/Test_quickfix_cwindow_1.dump, src/testdir/dumps/Test_quickfix_cwindow_2.dump ***

Patch 8.1.2041

2019-09-15 Thread Bram Moolenaar
Patch 8.1.2041 (after 8.1.2040) Problem:No test for diff mode with syntax highlighting. Solution: Add a test case. Files: src/testdir/test_diffmode.vim, src/testdir/dumps/Test_diff_syntax_1.dump *** ../vim-8.1.2040/src/testdir/test_diffmode.vim 2019-09-06 21:34:25.

Re: Regression using "-d" after 2027

2019-09-15 Thread Bram Moolenaar
Aaron Heifetz wrote: > a) Also tried with "-d -i NONE -N -u NONE --noplugin -U NONE > .\Make_cyg_ming.mak .\Make_cyg_ming_ori.mak": > > > [image: 116.png] OK, now I see what you mean. Strange that no screenshot test failed for this. It's already fixed with patch 8.1.2040. -- hundred-and

Re: Patch 8.1.2035

2019-09-15 Thread 'Andy Wokula' via vim_dev
Am 15.09.2019 um 14:33 schrieb Bram Moolenaar: Patch 8.1.2035 Problem:Recognizing octal numbers is confusing. Solution: Introduce scriptversion 4: do not use octal and allow for single quote inside numbers. Files: runtime/doc/eval.txt, src/vim.h, src/eval.c, src/scriptfile

Patch 8.1.2042

2019-09-15 Thread Bram Moolenaar
Patch 8.1.2042 Problem:The evalfunc.c file is too big. Solution: Move getchar() and parse_queued_messages() to getchar.c. Files: src/getchar.c, src/proto/getchar.pro, src/evalfunc.c, src/misc2.c, src/proto/misc2.pro *** ../vim-8.1.2041/src/getchar.c 2019-08-21 14:36

Re: Patch 8.1.2035

2019-09-15 Thread Bram Moolenaar
Andy Wokula wrote: > Am 15.09.2019 um 14:33 schrieb Bram Moolenaar: > > Patch 8.1.2035 > > Problem:Recognizing octal numbers is confusing. > > Solution: Introduce scriptversion 4: do not use octal and allow for single > > quote inside numbers. > > Files: runtime/doc/e

Patch 8.1.2043

2019-09-15 Thread Bram Moolenaar
Patch 8.1.2043 Problem:Not sufficient testing for quoted numbers. Solution: Add a few more test cases. Files: src/testdir/test_functions.vim, src/testdir/test_eval_stuff.vim *** ../vim-8.1.2042/src/testdir/test_functions.vim 2019-09-15 14:32:49.556731456 +0200 --- src/testdir/t

Re: Channel based plugins and scheduling

2019-09-15 Thread Bram Moolenaar
I was wondering where to trigger SafeState. I first thought it would be sufficient to do this higher up, where we are going to wait for the user to type a character and nothing is pending. Then it's safe to deal with any callbacks. However, think of this scenario: 1. In a safe state, S

Patch 8.1.2044

2019-09-15 Thread Bram Moolenaar
Patch 8.1.2044 Problem:No easy way to process postponed work. (Paul Jolly) Solution: Add the SafeState autocommand event. Files: runtime/doc/autocmd.txt, src/main.c, src/proto/main.pro, src/vim.h, src/autocmd.c, src/channel.c, src/edit.c, src/ex_getln.c *** ..