File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed
Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -2144,7 +2144,8 @@ getline_peek_skip_comments(evalarg_T *evalarg)
21442144 p = skipwhite (next );
21452145 if (* p != NUL && !vim9_comment_start (p ))
21462146 return next ;
2147- (void )eval_next_line (evalarg );
2147+ if (eval_next_line (evalarg ) == NULL )
2148+ break ;
21482149 }
21492150 return NULL ;
21502151}
@@ -2199,6 +2200,9 @@ eval_next_line(evalarg_T *evalarg)
21992200 GETLINE_CONCAT_ALL );
22002201 else
22012202 line = next_line_from_context (evalarg -> eval_cctx , TRUE);
2203+ if (line == NULL )
2204+ return NULL ;
2205+
22022206 ++ evalarg -> eval_break_count ;
22032207 if (gap -> ga_itemsize > 0 && ga_grow (gap , 1 ) == OK )
22042208 {
Original file line number Diff line number Diff line change @@ -1830,6 +1830,24 @@ def Test_execute_cmd_vimscript()
18301830 v9.CheckScriptSuccess (lines )
18311831enddef
18321832
1833+ def Test_execute_finish ()
1834+ # the empty lines are relevant here
1835+ var lines = << trim END
1836+ vim9script
1837+
1838+ var vname = " g:hello"
1839+
1840+ if exists (vname) | finish | endif | execute vname ' = "world"'
1841+
1842+ assert_equal (' world' , g: hello )
1843+
1844+ if exists (vname) | finish | endif | execute vname ' = "world"'
1845+
1846+ assert_report (' should not be reached' )
1847+ END
1848+ v9.CheckScriptSuccess (lines )
1849+ enddef
1850+
18331851def Test_echo_cmd ()
18341852 echo ' some' # comment
18351853 echon ' thing'
Original file line number Diff line number Diff line change @@ -750,6 +750,8 @@ static char *(features[]) =
750750
751751static int included_patches [] =
752752{ /* Add new patch number below this line */
753+ /**/
754+ 4622 ,
753755/**/
754756 4621 ,
755757/**/
You can’t perform that action at this time.
0 commit comments