]> granicus.if.org Git - vim/commitdiff
patch 7.4.2121 v7.4.2121
authorBram Moolenaar <Bram@vim.org>
Fri, 29 Jul 2016 20:50:35 +0000 (22:50 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 29 Jul 2016 20:50:35 +0000 (22:50 +0200)
Problem:    No easy way to check if lambda and closure are supported.
Solution:   Add the +lambda feature.

src/evalfunc.c
src/testdir/test_lambda.vim
src/version.c

index 53783af740e40ff12d9b5b28a5314729eddab8f0..f665842428e7863dedb43d4f2ee5f708c629cf9b 100644 (file)
@@ -5205,6 +5205,7 @@ f_has(typval_T *argvars, typval_T *rettv)
 #ifdef FEAT_KEYMAP
        "keymap",
 #endif
+       "lambda", /* always with FEAT_EVAL, since 7.4.2120 with closure */
 #ifdef FEAT_LANGMAP
        "langmap",
 #endif
index 9eb34e434ecd55e3c85adaa4579e1c113f039934..511873807618e9eaa36177169214400d8a422265 100644 (file)
@@ -1,5 +1,9 @@
 " Test for lambda and closure
 
+function! Test_lambda_feature()
+  call assert_equal(1, has('lambda'))
+endfunction
+
 function! Test_lambda_with_filter()
   let s:x = 2
   call assert_equal([2, 3], filter([1, 2, 3], {i, v -> v >= s:x}))
index 7e8ca166e16503dd3dd2f4c649cf8460a3dbacc2..4af1468a7d102eabb2d9b4c1b642faa3233b3907 100644 (file)
@@ -304,6 +304,11 @@ static char *(features[]) =
 #else
        "-keymap",
 #endif
+#ifdef FEAT_EVAL
+       "+lambda",
+#else
+       "-lambda",
+#endif
 #ifdef FEAT_LANGMAP
        "+langmap",
 #else
@@ -758,6 +763,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2121,
 /**/
     2120,
 /**/