• R/O
  • SSH

vim: コミット

Mirror of the Vim source from https://github.com/vim/vim


コミットメタ情報

リビジョン376b520312d64b8209965a727043539e85e54082 (tree)
日時2020-07-01 04:00:03
作者Bram Moolenaar <Bram@vim....>
コミッターBram Moolenaar

ログメッセージ

patch 8.2.1098: Vim9: cannot use line break in :throw argument

Commit: https://github.com/vim/vim/commit/006ad48b8a15c3bace741d8caaf3195e592fbe78
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jun 30 20:55:15 2020 +0200

patch 8.2.1098: Vim9: cannot use line break in :throw argument
Problem: Vim9: cannot use line break in :throw argument.
Solution: Check for line break.

変更サマリ

差分

diff -r 99a602b27e0e -r 376b520312d6 src/eval.c
--- a/src/eval.c Tue Jun 30 20:45:06 2020 +0200
+++ b/src/eval.c Tue Jun 30 21:00:03 2020 +0200
@@ -333,10 +333,18 @@
333333 {
334334 typval_T tv;
335335 char_u *retval;
336-
336+ evalarg_T evalarg;
337+
338+ CLEAR_FIELD(evalarg);
339+ evalarg.eval_flags = skip ? 0 : EVAL_EVALUATE;
340+ if (eap != NULL && getline_equal(eap->getline, eap->cookie, getsourceline))
341+ {
342+ evalarg.eval_getline = eap->getline;
343+ evalarg.eval_cookie = eap->cookie;
344+ }
337345 if (skip)
338346 ++emsg_skip;
339- if (eval0(arg, &tv, eap, skip ? NULL : &EVALARG_EVALUATE) == FAIL || skip)
347+ if (eval0(arg, &tv, eap, &evalarg) == FAIL || skip)
340348 retval = NULL;
341349 else
342350 {
@@ -345,7 +353,7 @@
345353 }
346354 if (skip)
347355 --emsg_skip;
348- clear_evalarg(&EVALARG_EVALUATE, eap);
356+ clear_evalarg(&evalarg, eap);
349357
350358 return retval;
351359 }
diff -r 99a602b27e0e -r 376b520312d6 src/testdir/test_vim9_script.vim
--- a/src/testdir/test_vim9_script.vim Tue Jun 30 20:45:06 2020 +0200
+++ b/src/testdir/test_vim9_script.vim Tue Jun 30 21:00:03 2020 +0200
@@ -585,6 +585,20 @@
585585 call CheckDefFailure(['throw xxx'], 'E1001:')
586586 enddef
587587
588+def Test_throw_vimscript()
589+ " only checks line continuation
590+ let lines =<< trim END
591+ vim9script
592+ try
593+ throw 'one'
594+ .. 'two'
595+ catch
596+ assert_equal('onetwo', v:exception)
597+ endtry
598+ END
599+ CheckScriptSuccess(lines)
600+enddef
601+
588602 if has('channel')
589603 let someJob = test_null_job()
590604
diff -r 99a602b27e0e -r 376b520312d6 src/version.c
--- a/src/version.c Tue Jun 30 20:45:06 2020 +0200
+++ b/src/version.c Tue Jun 30 21:00:03 2020 +0200
@@ -755,6 +755,8 @@
755755 static int included_patches[] =
756756 { /* Add new patch number below this line */
757757 /**/
758+ 1098,
759+/**/
758760 1097,
759761 /**/
760762 1096,
旧リポジトリブラウザで表示