Patch 8.2.1707

8 views
Skip to first unread message

Bram Moolenaar

unread,
Sep 18, 2020, 3:54:48 PM9/18/20
to vim...@googlegroups.com

Patch 8.2.1707
Problem: Small inconsitency in highlight test.
Solution: Use one argument for :execute. (Antony Scriven, #6975)
Files: src/testdir/test_highlight.vim


*** ../vim-8.2.1705/src/vim9execute.c 2020-09-17 21:28:59.939951846 +0200
--- src/vim9execute.c 2020-09-18 21:23:08.323468431 +0200
***************
*** 2676,2690 ****
continue;

func_return:
! // Restore previous function. If the frame pointer is zero then there
! // is none and we are done.
if (ectx.ec_frame_idx == initial_frame_idx)
- {
- if (handle_closure_in_use(&ectx, FALSE) == FAIL)
- // only fails when out of memory
- goto failed;
goto done;
! }
if (func_return(&ectx) == FAIL)
// only fails when out of memory
goto failed;
--- 2676,2686 ----
continue;

func_return:
! // Restore previous function. If the frame pointer is where we started
! // then there is none and we are done.
if (ectx.ec_frame_idx == initial_frame_idx)
goto done;
!
if (func_return(&ectx) == FAIL)
// only fails when out of memory
goto failed;
***************
*** 2703,2708 ****
--- 2699,2708 ----
ret = OK;

failed:
+ // Also deal with closures when failed, they may already be in use
+ // somewhere.
+ handle_closure_in_use(&ectx, FALSE);
+
// When failed need to unwind the call stack.
while (ectx.ec_frame_idx != initial_frame_idx)
func_return(&ectx);
*** ../vim-8.2.1705/src/testdir/test_vim9_func.vim 2020-09-16 23:23:33.026882158 +0200
--- src/testdir/test_vim9_func.vim 2020-09-18 21:22:45.115547868 +0200
***************
*** 1294,1299 ****
--- 1294,1313 ----
GetResult(g:Ref)->assert_equal('sometext')
enddef

+ def Test_double_closure_fails()
+ let lines =<< trim END
+ vim9script
+ def Func()
+ let var = 0
+ for i in range(2)
+ timer_start(0, {-> var})
+ endfor
+ enddef
+ Func()
+ END
+ CheckScriptFailure(lines, 'Multiple closures not supported yet')
+ enddef
+
def Test_sort_return_type()
let res: list<number>
res = [1, 2, 3]->sort()
*** ../vim-8.2.1705/src/version.c 2020-09-18 19:40:41.670037639 +0200
--- src/version.c 2020-09-18 21:24:32.943178148 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 1706,
/**/

--
There are two ways of constructing a software design. One way is to make
it so simple that there are obviously no deficiencies. The other way
is to make it so complicated that there are no obvious deficiencies.
-C.A.R. Hoare

/// Bram Moolenaar -- Br...@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 ///

Bram Moolenaar

unread,
Sep 18, 2020, 3:56:31 PM9/18/20
to vim...@googlegroups.com, Bram Moolenaar

I wrote:

> Patch 8.2.1707
> Problem: Small inconsitency in highlight test.
> Solution: Use one argument for :execute. (Antony Scriven, #6975)
> Files: src/testdir/test_highlight.vim

Wrong patch, should be this:


*** ../vim-8.2.1706/src/testdir/test_highlight.vim 2020-09-18 19:40:41.666037655 +0200
--- src/testdir/test_highlight.vim 2020-09-18 21:52:49.702408402 +0200
***************
*** 886,896 ****
let patContextDefault = fnamemodify(scriptContextDefault, ':t') .. ' line 1'
let patContextRelink = fnamemodify(scriptContextRelink, ':t') .. ' line 2'

! exec "source" scriptContextDefault
let hlContextDefault = execute("verbose hi Context")
call assert_match(patContextDefault, hlContextDefault)

! exec "source" scriptContextRelink
let hlContextRelink = execute("verbose hi Context")
call assert_match(patContextRelink, hlContextRelink)

--- 886,896 ----
let patContextDefault = fnamemodify(scriptContextDefault, ':t') .. ' line 1'
let patContextRelink = fnamemodify(scriptContextRelink, ':t') .. ' line 2'

! exec 'source ' .. scriptContextDefault
let hlContextDefault = execute("verbose hi Context")
call assert_match(patContextDefault, hlContextDefault)

! exec 'source ' .. scriptContextRelink
let hlContextRelink = execute("verbose hi Context")
call assert_match(patContextRelink, hlContextRelink)

*** ../vim-8.2.1706/src/version.c 2020-09-18 21:25:28.742986212 +0200
--- src/version.c 2020-09-18 21:52:37.418447744 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 1707,
/**/

--
Clothes make the man. Naked people have little or no influence on society.
-- Mark Twain (Samuel Clemens) (1835-1910)
Reply all
Reply to author
Forward
0 new messages