aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Ennen <mike.ennen@gmail.com>2016-10-27 13:53:53 -0700
committerJames McCoy <jamessan@jamessan.com>2016-12-12 10:17:35 -0500
commit5241ca7d7a8c3a08af8bbfbf7cca3381241a915b (patch)
treec2fb2794fd7254a1fb09eb0c3b84f874a1324696
parent34a7814219b835e8d552cac890ccdf67aad65b2a (diff)
downloadrneovim-5241ca7d7a8c3a08af8bbfbf7cca3381241a915b.tar.gz
rneovim-5241ca7d7a8c3a08af8bbfbf7cca3381241a915b.tar.bz2
rneovim-5241ca7d7a8c3a08af8bbfbf7cca3381241a915b.zip
vim-patch:7.4.1606
Problem: Having type() handle a Funcref that is or isn't a partial differently causes problems for existing scripts. Solution: Make type() return the same value. (Thinca) https://github.com/vim/vim/commit/953cc7fb139dc2ba8590f8b03a095b63f4e1208f
-rw-r--r--src/nvim/eval.c2
-rw-r--r--src/nvim/testdir/test_viml.vim1
-rw-r--r--src/nvim/version.c2
3 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 1cd52832ee..1be3476e35 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -17107,6 +17107,7 @@ static void f_type(typval_T *argvars, typval_T *rettv, FunPtr fptr)
switch (argvars[0].v_type) {
case VAR_NUMBER: n = VAR_TYPE_NUMBER; break;
case VAR_STRING: n = VAR_TYPE_STRING; break;
+ case VAR_PARTIAL:
case VAR_FUNC: n = VAR_TYPE_FUNC; break;
case VAR_LIST: n = VAR_TYPE_LIST; break;
case VAR_DICT: n = VAR_TYPE_DICT; break;
@@ -17125,7 +17126,6 @@ static void f_type(typval_T *argvars, typval_T *rettv, FunPtr fptr)
}
break;
}
- case VAR_PARTIAL: n = 8; break;
case VAR_UNKNOWN: {
EMSG2(_(e_intern2), "f_type(UNKNOWN)");
break;
diff --git a/src/nvim/testdir/test_viml.vim b/src/nvim/testdir/test_viml.vim
index a11d62f5cf..2f9a72d618 100644
--- a/src/nvim/testdir/test_viml.vim
+++ b/src/nvim/testdir/test_viml.vim
@@ -943,6 +943,7 @@ func Test_type()
call assert_equal(0, type(0))
call assert_equal(1, type(""))
call assert_equal(2, type(function("tr")))
+ call assert_equal(2, type(function("tr", [8])))
call assert_equal(3, type([]))
call assert_equal(4, type({}))
call assert_equal(5, type(0.0))
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 2e711797f4..a3df79d0c3 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -836,7 +836,7 @@ static int included_patches[] = {
// 1609 NA
// 1608,
// 1607,
- // 1606,
+ 1606,
1605,
1604,
1603,